commit e16ea1fee32b8f7510e970386b5405630a8d0456 Author: Jonadab the Unsightly One Date: Wed Mar 25 21:34:52 2015 -0400 Add a couple more palettes. This adds the following palettes: * Saturated: uses highly saturated colors (very little gray, except of course in the ones that are supposed to be gray). This palette is designed specifically for NetHack, so the bright version of red is orange. * Tertiary: uses softer, gentler, less saturated colors (but still far enough from gray that you can easily tell which is which). This palette is designed specifically for NetHack, so the bright version of red is orange. * Typical Terminal. Copies the black-background color scheme of a typical X11-based terminal that ships with a popular desktop environment. I assume we don't want the set designed for white background, because then "white" things (including white potions and probably even white dragons) would need to be dark to show, which would be weird. This is a standard terminal color set, not specifically designed for NetHack, so the bright version of red is bright red, not orange. * Linux Console. An alternate set provided with some popular terminals, designed to emulate non-GUI virtual terminals. This is a standard terminal color set, not specifically designed for NetHack, so the bright version of red is bright red, not orange. diff --git a/nethack/include/nhcurses.h b/nethack/include/nhcurses.h index 6b811be..a3b3271 100644 --- a/nethack/include/nhcurses.h +++ b/nethack/include/nhcurses.h @@ -219,28 +219,32 @@ enum nh_text_mode { /* Tilesets, defaulting to Unicode if tiles are not available */ TILESET_DAWNLIKE_16, /* DawnLike by DragonDePlatino */ TILESET_DAWNLIKE_32, /* The same, upscaled */ TILESET_RLTILES_32, /* RLTiles by many contributors, provided by Raz */ /* Slash'EM has its own tilesets (many of which are unfinished) */ TILESET_SLASHEM_16, TILESET_SLASHEM_32, TILESET_SLASHEM_3D, }; enum nh_palette { PALETTE_NONE, /* Keep default terminal palette */ - PALETTE_DEFAULT, /* The default palette */ - PALETTE_ALT1, /* Alternative palette 1*/ - PALETTE_ALT2, /* Alternative palette 2*/ - PALETTE_ALT3, /* Alternative palette 3*/ + PALETTE_DEFAULT, /* The libuncursed default palette */ + PALETTE_ALT1, /* Alternative palette 1, stef70 */ + PALETTE_ALT2, /* Alternative palette 2, stef70 */ + PALETTE_ALT3, /* Alternative palette 3, stef70 */ + PALETTE_SATURATED, /* Saturated Colors, jonadab */ + PALETTE_TERTIARY, /* Tertiary Colors, jonadab */ + PALETTE_TTERMINAL, /* Defaults from a typical X11 terminal */ + PALETTE_LCONSOLE, /* Konsole claims these are the Linux vt values */ }; enum nh_animation { ANIM_INSTANT, /* no animation */ ANIM_INTERRUPTIBLE, /* animate only interruptible events */ ANIM_ALL, /* animate all events */ ANIM_SLOW, /* animate all events, slowly */ }; enum nh_motd_setting { MOTD_TRUE, MOTD_FALSE, diff --git a/nethack/src/options.c b/nethack/src/options.c index 22f9a44..9cb6974 100644 --- a/nethack/src/options.c +++ b/nethack/src/options.c @@ -55,26 +55,30 @@ static struct nh_listitem graphics_list[] = { /* We don't have an upscaler for this yet. {TILESET_DAWNLIKE_32, "Tiles (DawnLike, 32px)"}, */ {TILESET_SLASHEM_16, "Tiles (Slash'EM, 16px)"}, /* Tilesets with missing images or rendering issues (or both): {TILESET_SLASHEM_32, "Tiles (32x32)"}, {TILESET_SLASHEM_3D, "Tiles (3D effect)"}, */ {TILESET_RLTILES_32, "Tiles (RLTiles, 32px)"}, }; static struct nh_enum_option graphics_spec = { graphics_list, listlen(graphics_list) }; static struct nh_listitem palette_list[] = { - {PALETTE_NONE, "none (may require new terminal)"}, - {PALETTE_DEFAULT, "default"}, + {PALETTE_NONE, "terminal default (may require new window)"}, + {PALETTE_DEFAULT, "uncursed default"}, + {PALETTE_SATURATED, "saturated bold"}, + {PALETTE_TERTIARY, "tertiary colors"}, + {PALETTE_TTERMINAL, "typical X11 terminal"}, + {PALETTE_LCONSOLE, "Linux console"}, {PALETTE_ALT1, "alternative 1"}, {PALETTE_ALT2, "alternative 2"}, {PALETTE_ALT3, "alternative 3"} }; static struct nh_enum_option palette_spec = { palette_list, listlen(palette_list) }; static struct nh_listitem animation_list[] = { {ANIM_INSTANT, "instant"}, {ANIM_INTERRUPTIBLE, "interruptible"}, {ANIM_ALL, "everything"}, {ANIM_SLOW, "slow"}, diff --git a/nethack/src/windows.c b/nethack/src/windows.c index 152db52..4d25ebf 100644 --- a/nethack/src/windows.c +++ b/nethack/src/windows.c @@ -675,42 +675,78 @@ setup_palette(void) {0x00,0x00,0x00},{0xCC,0x00,0x00},{0x3E,0xAA,0x06},{0xC4,0xC0,0x00}, {0x34,0x65,0xFF},{0xA5,0x70,0x9B},{0x06,0xB8,0xBA},{0xEE,0xEE,0xEE}, {0x88,0x88,0x88},{0xEF,0x29,0x29},{0x8A,0xE2,0x34},{0xFC,0xE9,0x4F}, {0x73,0x9F,0xFF},{0xAD,0x7F,0xA8},{0x34,0xE2,0xE2},{0xFF,0xFF,0xFF}, }}; static const uncursed_palette16 palette_alt3 = {{ {0x00,0x00,0x00},{0xDC,0x32,0x2F},{0x85,0x99,0x00},{0xB5,0x89,0x00}, {0x26,0x8B,0xD2},{0xF3,0x36,0x82},{0x2A,0xA1,0x98},{0xEE,0xE8,0xD5}, {0x88,0x88,0x88},{0xEF,0x29,0x29},{0x8A,0xE2,0x34},{0xFC,0xE9,0x4F}, {0x73,0x9F,0xFF},{0xAD,0x7F,0xA8},{0x34,0xE2,0xE2},{0xFF,0xFF,0xFF}, }}; + static const uncursed_palette16 palette_saturated = {{ + {0x00,0x00,0x00}, {0xbb,0x00,0x00}, {0x00,0xbb,0x00}, {0xcb,0x6e,0x00}, + {0x00,0x00,0xcc}, {0xb1,0x00,0xbc}, {0x00,0xbb,0xaa}, {0xbb,0xbb,0xbb}, + {0x55,0x55,0x55}, {0xff,0x99,0x33}, {0xbb,0xff,0x00}, {0xff,0xee,0x00}, + {0x00,0xaa,0xff}, {0xff,0x7f,0xbb}, {0x7f,0xff,0xff}, {0xff,0xff,0xff}, + }}; + static const uncursed_palette16 palette_tertiary = {{ + {0x22,0x40,0x3d}, {0xab,0x6d,0x63}, {0x86,0xa0,0x60}, {0xb5,0x87,0x52}, + {0x48,0x76,0xa9}, {0x74,0x53,0xb8}, {0x4e,0xa2,0x91}, {0xc0,0xb7,0xa7}, + {0x3e,0x59,0x57}, {0xff,0xc4,0x61}, {0xc1,0xf8,0x94}, {0xff,0xed,0x76}, + {0x94,0xd3,0xf8}, {0xf8,0xac,0xd7}, {0x94,0xf8,0xe2}, {0xff,0xf3,0xde}, + }}; + static const uncursed_palette16 palette_typical_term = {{ + {0x2e,0x34,0x36}, {0xcc,0x00,0x00}, {0x4e,0x9a,0x06}, {0xc4,0xa0,0x00}, + {0x34,0x65,0xa4}, {0xff,0x00,0xe4}, {0x00,0xfb,0xff}, {0xd3,0xd7,0xcf}, + {0x56,0x56,0x54}, {0xee,0x30,0x30}, {0x8a,0xe2,0x34}, {0xfc,0xe9,0x4f}, + {0x72,0x9f,0xcf}, {0xb2,0x92,0xaf}, {0xa2,0xff,0xff}, {0xee,0xee,0xec}, + }}; + static const uncursed_palette16 palette_lin_console = {{ + {0x00,0x00,0x00}, {0xb2,0x18,0x18}, {0x18,0xb2,0x18}, {0xb2,0x68,0x18}, + {0x18,0x18,0xb2}, {0xb2,0x18,0xb2}, {0x18,0xb2,0xb2}, {0xb2,0xb2,0xb2}, + {0x68,0x68,0x68}, {0xff,0x54,0x54}, {0x54,0xff,0x54}, {0xff,0xff,0x54}, + {0x54,0x54,0xff}, {0xff,0x54,0xff}, {0x54,0xff,0xff}, {0xff,0xff,0xff}, + }}; switch (settings.palette) { - case PALETTE_NONE: - uncursed_reset_palette16(); - return; case PALETTE_ALT1: uncursed_set_palette16(&palette_alt1); return; case PALETTE_ALT2: uncursed_set_palette16(&palette_alt2); return; case PALETTE_ALT3: uncursed_set_palette16(&palette_alt3); return; + case PALETTE_SATURATED: + uncursed_set_palette16(&palette_saturated); + return; + case PALETTE_TERTIARY: + uncursed_set_palette16(&palette_tertiary); + return; + case PALETTE_TTERMINAL: + uncursed_set_palette16(&palette_typical_term); + return; + case PALETTE_LCONSOLE: + uncursed_set_palette16(&palette_lin_console); + return; case PALETTE_DEFAULT: - default: uncursed_set_palette16(&palette_default); return; + case PALETTE_NONE: + default: + uncursed_reset_palette16(); + return; } } static nh_bool setup_tiles(void) { switch (settings.graphics) { case TILESET_DAWNLIKE_16: set_tile_file("dawnlike-16.nh4ct"); return TRUE; case TILESET_DAWNLIKE_32: