Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Sil

Reply
 
Thread Tools Display Modes
Old January 8, 2018, 11:54   #1
mibert
Scout
 
Join Date: Mar 2016
Posts: 27
mibert is on a distinguished road
gcu on linux with colors?

Hey all,

does anyone know whether any version (sil, q, mpa) can be compiled with ncurses so that the gcu version runs with correct colors and also the background thing for unwary monsters?

Thanks a lot!
mibert is offline   Reply With Quote
Old January 8, 2018, 12:49   #2
Gwarl
Knight
 
Join Date: Jan 2017
Posts: 602
Gwarl is on a distinguished road
Sil-Q works correctly (I know because I fixed it). If you simply copy the main-gcu.c file from Sil-Q over the one in regular Sil, regular Sil will work correctly as well.
Gwarl is offline   Reply With Quote
Old January 8, 2018, 14:08   #3
mibert
Scout
 
Join Date: Mar 2016
Posts: 27
mibert is on a distinguished road
Quote:
Originally Posted by Gwarl View Post
Sil-Q works correctly (I know because I fixed it). If you simply copy the main-gcu.c file from Sil-Q over the one in regular Sil, regular Sil will work correctly as well.
cool, thats great news.

I compiled a freshly pulled sil-q with these pre-defined settings:
Code:
DEFINES= -D"USE_GCU"
CFLAGS = -std=c99 -O2 -fno-strength-reduce -pipe
LIBS = -lcurses
But the executable gives me:
Code:
./sil: Unable to prepare any 'display module' (such as 'x11' or 'gcu')!
I then used my own settings:
Code:
CFLAGS = -std=c99 -O1 -pipe -g -D"USE_GCU" -I/usr/include/ncurses
LIBS = -lncurses
The game will then start just fine, but already on 50ft i can see that sleeping monsters do not have the respective background.

Any help/idea would be really be appreciated
mibert is offline   Reply With Quote
Old January 8, 2018, 20:42   #4
Quirk
Adept
 
Join Date: Mar 2016
Posts: 211
Quirk is on a distinguished road
I'm afraid Sil-Q doesn't have the background colour highlighting for GCU either. I had a quick glance over it, but it looks to me like it requires the GCU colour handling to be overhauled to permit altering background colour. It's currently set using ncurses init_pair to initialise background and foreground colour together, and has a table of just 16 colours; it masks colours it encounters with 0xF to only use the last nibble. I'd need to extend the colour table, which might be easy or might not, I haven't really dug into this very much.

Something that will definitely be in the next release is [ and ] to show you a list of monsters and objects, Angband style, and that will also tell you which monsters are wary or unwary.

Apologies for the makefile issue; I merged someone else's changes and didn't copy Makefile.std over my Makefile so hadn't tested. I'll fix accordingly.

Last edited by Quirk; January 8, 2018 at 21:36.
Quirk is offline   Reply With Quote
Old January 8, 2018, 21:46   #5
Gwarl
Knight
 
Join Date: Jan 2017
Posts: 602
Gwarl is on a distinguished road
That's how it did work before I copied the colour handling from V over it. The 16 color pairs is more or less dead code now.
Gwarl is offline   Reply With Quote
Old January 9, 2018, 10:27   #6
Quirk
Adept
 
Join Date: Mar 2016
Posts: 211
Quirk is on a distinguished road
Quote:
Originally Posted by Gwarl View Post
That's how it did work before I copied the colour handling from V over it. The 16 color pairs is more or less dead code now.
No, this is not true. The colour handling in the patch you applied still supports just 16 colours and the colour table has just 16 entries; there's a loop from i = 0 while i < 16 to fill them in, you can verify this for yourself. The difference is that it's using the xterm colour pairs not the built-in curses colour pairs, and it's overwriting the curses colours on receiving TERM_XTRA_REACT while compiled in 256 colour mode.
Quirk is offline   Reply With Quote
Old January 9, 2018, 13:35   #7
Gwarl
Knight
 
Join Date: Jan 2017
Posts: 602
Gwarl is on a distinguished road
I will confess I didn't bother to understand how it all worked, I just copied from poschengband which in turn had copied from V. But we definitely have more than 16 colors now, and angband itself iirc defines 27 colors. The main-gcu file to my understanding maps angband's internal colors to the 16 color pairs, and the patch maps them to xterm colors (all 27 of them).

Again though it was mostly just copy/paste work that I did and it's entirely possible I'm wrong. MPA-Sil has its own 256 color support, but those colors look 'wrong' to me which is why I went with the vanilla patch instead.
Gwarl is offline   Reply With Quote
Old January 10, 2018, 12:58   #8
Quirk
Adept
 
Join Date: Mar 2016
Posts: 211
Quirk is on a distinguished road
From the comment in your patch:

Code:
/* If we have more than 16 colors, find the best matches. These numbers
 * correspond to xterm/rxvt's builtin color numbers--they do not
 * correspond to curses' constants OR with curses' color pairs.
 *
 * XTerm has 216 (6*6*6) RGB colors, with each RGB setting 0-5.
 * RXVT has 64 (4*4*4) RGB colors, with each RGB setting 0-3.
 *
 * Both also have the basic 16 ANSI colors, plus some extra grayscale
 * colors which we do not use.
 */
This is followed by looping over the 16 colours in the GCU "colortable" array, finding the most appropriate colour in the XTerm or RXVT colour space to use, and using it. Only the first 16 Angband colours (there are 32, specified in a table large enough to hold 256, the rest of the data apparently uninitialised!) are scaled into XTerm or RXVT colour space.

For the most part it isn't really an issue - you don't want to have colours so similar that you're trying to determine whether that's a mauve 'd' or a lilac 'd' you're facing off against - but since in the GCU implementation the background colour is linked to the foreground colour, more work would need to be done to be able to change the background colour to highlight unwary monsters.
Quirk is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Keypad not working with GCU looney Vanilla 1 August 18, 2014 05:14
Balance of subwindows GCU Kramborn Development 0 June 15, 2013 19:45
[gcu version] strange colors in old variants? the solution is here ghengiz Development 3 January 28, 2012 15:29
Question about colors AnonymousHero Development 2 April 22, 2011 19:44
Monster colors Timo Pietilš Development 13 June 25, 2010 06:51


All times are GMT +1. The time now is 03:17.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.