CHANGE_COLOR palette option adjustments

It was too early to call the windowport change_color() routine
while processing the config file. The windowport was not yet
fully operational.

Now the palette option processing will just place the rgb
value into the appropriate ga.altpalette[CLR_MAX] entry.

init_sound_disp_gamewindows(void) [allmain.c] calls
change_palette() [coloratt.c] and it will call the windowport
change_color() function for each ga.altpalette[] entry that
has been set.

Notes:
The rgb values stored in ga.altpalette[] have the NH_ALTPALETTE bit set
so that the rgb value of 0 can be stored and be distinguishable from
a "not set" entry.

The NH_ALTPALETTE bit is cleared from the rgb value in change_palette()
prior to calling the windowport change_color() function.

The syntax for palette is colorname/r-g-b.
For example: palette:black/12-12-12

colorname must be one of the NH_BASIC_COLOR names or a suitable
alias for one of those 16 entries.

Some of the windowport CHANGE_COLOR functions had the wrong parameters,
perhaps due to bitrot. Those have been corrected to match the prototype.
This commit is contained in:
nhmall
2024-04-12 21:57:27 -04:00
parent 749f2ffb0e
commit 15db874f71
13 changed files with 239 additions and 62 deletions

View File

@@ -667,6 +667,13 @@ init_sound_disp_gamewindows(void)
SoundAchievement(0, sa2_newgame_nosplash, 0);
}
#ifdef CHANGE_COLOR
/* init_nhwindows() has already been called, so before
creating the windows, check to see if there are any
palette entries to alter */
change_palette();
#endif
WIN_MESSAGE = create_nhwindow(NHW_MESSAGE);
if (VIA_WINDOWPORT()) {
status_initialize(0);