console colour follow up 2

If you specified one or more palete options in the config file,
but not all 16, you ended up with black for any you didn't
specify - oops.

This patch ensures that the table has a full complement
of 16 colours by initializing it to the windows default colours
just ahead of the first palette option encountered.

As before, if the config file has no palette option in it,
no calls to change the palette are made at all. If the
undocumented method breaks in a future release of
Windows, then avoiding palette options will work
around the problem.
This commit is contained in:
nethack.allison
2006-09-09 19:38:25 +00:00
parent e05b7659e8
commit 94bc5885b1

View File

@@ -1031,6 +1031,11 @@ long rgb;
UserDefinedColors[k] = NetHackColors[k];
return;
} else if (color_number >= 0 && color_number < CLR_MAX) {
if (!altered_palette) {
/* make sure a full suite is available */
for (k=0; k < CLR_MAX; k++)
UserDefinedColors[k] = DefaultColors[k];
}
idx = win32_color_number[color_number];
UserDefinedColors[idx] = rgb;
}