![]() |
#1 |
Apprentice
Join Date: Mar 2016
Posts: 54
![]() |
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! |
![]() |
![]() |
![]() |
#2 |
Knight
Join Date: Jan 2017
Posts: 862
![]() |
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.
|
![]() |
![]() |
![]() |
#3 | |
Apprentice
Join Date: Mar 2016
Posts: 54
![]() |
Quote:
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 Code:
./sil: Unable to prepare any 'display module' (such as 'x11' or 'gcu')! Code:
CFLAGS = -std=c99 -O1 -pipe -g -D"USE_GCU" -I/usr/include/ncurses LIBS = -lncurses Any help/idea would be really be appreciated ![]() |
|
![]() |
![]() |
![]() |
#4 |
Swordsman
Join Date: Mar 2016
Posts: 371
![]() |
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 20:36. |
![]() |
![]() |
![]() |
#5 |
Knight
Join Date: Jan 2017
Posts: 862
![]() |
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.
|
![]() |
![]() |
![]() |
#6 |
Swordsman
Join Date: Mar 2016
Posts: 371
![]() |
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.
|
![]() |
![]() |
![]() |
#7 |
Knight
Join Date: Jan 2017
Posts: 862
![]() |
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. |
![]() |
![]() |
![]() |
#8 |
Swordsman
Join Date: Mar 2016
Posts: 371
![]() |
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. */ 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. |
![]() |
![]() |
![]() |
#9 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,747
Donated: $60
![]() |
I just came across this post on reddit which seems relevant here - there was a mention of having to edit main-gcu.c a bit, but it does look very pretty.
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Keypad not working with GCU | looney | Vanilla | 1 | August 18, 2014 04:14 |
Balance of subwindows GCU | Kramborn | Development | 0 | June 15, 2013 18:45 |
[gcu version] strange colors in old variants? the solution is here | ghengiz | Development | 3 | January 28, 2012 14:29 |
Question about colors | AnonymousHero | Development | 2 | April 22, 2011 18:44 |
Monster colors | Timo Pietilä | Development | 13 | June 25, 2010 05:51 |