]> granicus.if.org Git - nethack/commitdiff
win32 palette option tweak
authornethack.allison <nethack.allison>
Thu, 5 Oct 2006 03:11:52 +0000 (03:11 +0000)
committernethack.allison <nethack.allison>
Thu, 5 Oct 2006 03:11:52 +0000 (03:11 +0000)
The palette option is supposed to be allowed in the config file
without a value for win32 to trigger a load of a predefined
NetHack palette, but that wasn't working.

This fixes that. To prevent the use of any palette modification
code at all, just leave the palette option out of the config
file entirely.

src/options.c
sys/winnt/nttty.c

index ae23b469eb8796588dcf5a3f048ca45c3cf52834..20cc5d1acbc0190e379fc2302c1f47a6c2af7f99 100644 (file)
@@ -1514,11 +1514,12 @@ boolean tinitial, tfrom_file;
 # ifdef MAC
            }
 # endif
+#ifdef WIN32CON
+           op = string_for_opt(opts, TRUE);
+           if (!alternative_palette(op))
+               badoption(opts);
+#else
            if ((op = string_for_opt(opts, FALSE)) != (char *)0) {
-# ifdef WIN32CON
-               if (!alternative_palette(op))
-                       badoption(opts);
-# else
                char *pt = op;
                int cnt, tmp, reverse;
                long rgb;
@@ -1558,8 +1559,8 @@ boolean tinitial, tfrom_file;
                    change_color(color_number, rgb, reverse);
                    color_number += color_incr;
                }
-# endif        /* !WIN32CON */
            }
+# endif        /* !WIN32CON */
            if (!initial) {
                need_redraw = TRUE;
            }
index 0d5812a5584bdeb1b2132896d29f3a630d5b3503..1c641c1f82683a2b955dabbe97f5dfe4aebe54be 100644 (file)
@@ -1087,7 +1087,6 @@ long rgb;
                /* copy the NetHack palette into UserDefinedColors */
                for (k=0; k < CLR_MAX; k++)
                        UserDefinedColors[k] = NetHackColors[k];
-               return;
        } else if (color_number >= 0 && color_number < CLR_MAX) {
                if (!altered_palette) {
                        /* make sure a full suite is available */