diff --git a/src/dehacked.c b/src/dehacked.c index 1279d7bd0..809cdfac0 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6770,91 +6770,130 @@ static const char *const ML_LIST[16] = { // This DOES differ from r_draw's Color_Names, unfortunately. // Also includes Super colors static const char *COLOR_ENUMS[] = { - "NONE", // SKINCOLOR_NONE - "WHITE", // SKINCOLOR_WHITE - "SILVER", // SKINCOLOR_SILVER - "GREY", // SKINCOLOR_GREY - "BLACK", // SKINCOLOR_BLACK - "BEIGE", // SKINCOLOR_BEIGE - "PEACH", // SKINCOLOR_PEACH - "BROWN", // SKINCOLOR_BROWN - "RED", // SKINCOLOR_RED - "CRIMSON", // SKINCOLOR_CRIMSON - "ORANGE", // SKINCOLOR_ORANGE - "RUST", // SKINCOLOR_RUST - "GOLD", // SKINCOLOR_GOLD - "YELLOW", // SKINCOLOR_YELLOW - "TAN", // SKINCOLOR_TAN - "MOSS", // SKINCOLOR_MOSS - "PERIDOT", // SKINCOLOR_PERIDOT - "GREEN", // SKINCOLOR_GREEN - "EMERALD", // SKINCOLOR_EMERALD - "AQUA", // SKINCOLOR_AQUA - "TEAL", // SKINCOLOR_TEAL - "CYAN", // SKINCOLOR_CYAN - "BLUE", // SKINCOLOR_BLUE - "AZURE", // SKINCOLOR_AZURE - "PASTEL", // SKINCOLOR_PASTEL - "PURPLE", // SKINCOLOR_PURPLE - "LAVENDER", // SKINCOLOR_LAVENDER - "MAGENTA", // SKINCOLOR_MAGENTA - "PINK", // SKINCOLOR_PINK - "ROSY", // SKINCOLOR_ROSY + "NONE", // SKINCOLOR_NONE, + + // Greyscale ranges + "WHITE", // SKINCOLOR_WHITE, + "BONE", // SKINCOLOR_BONE, + "SILVER", // SKINCOLOR_SILVER, + "GREY", // SKINCOLOR_GREY, + "CLOUDY", // SKINCOLOR_CLOUDY, + "CARBON", // SKINCOLOR_CARBON, + "JET", // SKINCOLOR_JET, + "BLACK", // SKINCOLOR_BLACK, + + // Desaturated + "AETHER", // SKINCOLOR_AETHER, + "SLATE", // SKINCOLOR_SLATE, + "PINK", // SKINCOLOR_PINK, + "YOGURT", // SKINCOLOR_YOGURT, + "BROWN", // SKINCOLOR_BROWN, + "TAN", // SKINCOLOR_TAN, + "BEIGE", // SKINCOLOR_BEIGE, + "MOSS", // SKINCOLOR_MOSS, + "AZURE", // SKINCOLOR_AZURE, + "LAVENDER", // SKINCOLOR_LAVENDER, + + // Viv's vivid colours (toast 21/07/17) + "RUBY", // SKINCOLOR_RUBY, + "SALMON", // SKINCOLOR_SALMON, + "RED", // SKINCOLOR_RED, + "CRIMSON", // SKINCOLOR_CRIMSON, + "FLAME", // SKINCOLOR_FLAME, + "PEACHY", // SKINCOLOR_PEACHY, + "QUAIL", // SKINCOLOR_QUAIL, + "SUNSET", // SKINCOLOR_SUNSET, + "APRICOT", // SKINCOLOR_APRICOT, + "ORANGE", // SKINCOLOR_ORANGE, + "RUST", // SKINCOLOR_RUST, + "GOLD", // SKINCOLOR_GOLD, + "SANDY", // SKINCOLOR_SANDY, + "YELLOW", // SKINCOLOR_YELLOW, + "OLIVE", // SKINCOLOR_OLIVE, + "LIME", // SKINCOLOR_LIME, + "PERIDOT", // SKINCOLOR_PERIDOT, + "GREEN", // SKINCOLOR_GREEN, + "FOREST", // SKINCOLOR_FOREST, + "EMERALD", // SKINCOLOR_EMERALD, + "MINT", // SKINCOLOR_MINT, + "SEAFOAM", // SKINCOLOR_SEAFOAM, + "AQUA", // SKINCOLOR_AQUA, + "TEAL", // SKINCOLOR_TEAL, + "WAVE", // SKINCOLOR_WAVE, + "CYAN", // SKINCOLOR_CYAN, + "SKY", // SKINCOLOR_SKY, + "CERULEAN", // SKINCOLOR_CERULEAN, + "ICY", // SKINCOLOR_ICY, + "SAPPHIRE", // SKINCOLOR_SAPPHIRE, + "CORNFLOWER", // SKINCOLOR_CORNFLOWER, + "BLUE", // SKINCOLOR_BLUE, + "COBALT", // SKINCOLOR_COBALT, + "VAPOR", // SKINCOLOR_VAPOR, + "DUSK", // SKINCOLOR_DUSK, + "PASTEL", // SKINCOLOR_PASTEL, + "PURPLE", // SKINCOLOR_PURPLE, + "BUBBLEGUM", // SKINCOLOR_BUBBLEGUM, + "MAGENTA", // SKINCOLOR_MAGENTA, + "NEON", // SKINCOLOR_NEON, + "VIOLET", // SKINCOLOR_VIOLET, + "LILAC", // SKINCOLOR_LILAC, + "PLUM", // SKINCOLOR_PLUM, + "ROSY", // SKINCOLOR_ROSY, // Super special awesome Super flashing colors! - "SUPERSILVER1", // SKINCOLOR_SUPERSILVER1 - "SUPERSILVER2", // SKINCOLOR_SUPERSILVER2, - "SUPERSILVER3", // SKINCOLOR_SUPERSILVER3, - "SUPERSILVER4", // SKINCOLOR_SUPERSILVER4, - "SUPERSILVER5", // SKINCOLOR_SUPERSILVER5, + "SUPERSILVER1", // SKINCOLOR_SUPERSILVER1 + "SUPERSILVER2", // SKINCOLOR_SUPERSILVER2, + "SUPERSILVER3", // SKINCOLOR_SUPERSILVER3, + "SUPERSILVER4", // SKINCOLOR_SUPERSILVER4, + "SUPERSILVER5", // SKINCOLOR_SUPERSILVER5, - "SUPERRED1", // SKINCOLOR_SUPERRED1 - "SUPERRED2", // SKINCOLOR_SUPERRED2, - "SUPERRED3", // SKINCOLOR_SUPERRED3, - "SUPERRED4", // SKINCOLOR_SUPERRED4, - "SUPERRED5", // SKINCOLOR_SUPERRED5, + "SUPERRED1", // SKINCOLOR_SUPERRED1 + "SUPERRED2", // SKINCOLOR_SUPERRED2, + "SUPERRED3", // SKINCOLOR_SUPERRED3, + "SUPERRED4", // SKINCOLOR_SUPERRED4, + "SUPERRED5", // SKINCOLOR_SUPERRED5, - "SUPERORANGE1", // SKINCOLOR_SUPERORANGE1 - "SUPERORANGE2", // SKINCOLOR_SUPERORANGE2, - "SUPERORANGE3", // SKINCOLOR_SUPERORANGE3, - "SUPERORANGE4", // SKINCOLOR_SUPERORANGE4, - "SUPERORANGE5", // SKINCOLOR_SUPERORANGE5, + "SUPERORANGE1", // SKINCOLOR_SUPERORANGE1 + "SUPERORANGE2", // SKINCOLOR_SUPERORANGE2, + "SUPERORANGE3", // SKINCOLOR_SUPERORANGE3, + "SUPERORANGE4", // SKINCOLOR_SUPERORANGE4, + "SUPERORANGE5", // SKINCOLOR_SUPERORANGE5, - "SUPERGOLD1", // SKINCOLOR_SUPERGOLD1 - "SUPERGOLD2", // SKINCOLOR_SUPERGOLD2, - "SUPERGOLD3", // SKINCOLOR_SUPERGOLD3, - "SUPERGOLD4", // SKINCOLOR_SUPERGOLD4, - "SUPERGOLD5", // SKINCOLOR_SUPERGOLD5, + "SUPERGOLD1", // SKINCOLOR_SUPERGOLD1 + "SUPERGOLD2", // SKINCOLOR_SUPERGOLD2, + "SUPERGOLD3", // SKINCOLOR_SUPERGOLD3, + "SUPERGOLD4", // SKINCOLOR_SUPERGOLD4, + "SUPERGOLD5", // SKINCOLOR_SUPERGOLD5, - "SUPERPERIDOT1", // SKINCOLOR_SUPERPERIDOT1 - "SUPERPERIDOT2", // SKINCOLOR_SUPERPERIDOT2, - "SUPERPERIDOT3", // SKINCOLOR_SUPERPERIDOT3, - "SUPERPERIDOT4", // SKINCOLOR_SUPERPERIDOT4, - "SUPERPERIDOT5", // SKINCOLOR_SUPERPERIDOT5, + "SUPERPERIDOT1", // SKINCOLOR_SUPERPERIDOT1 + "SUPERPERIDOT2", // SKINCOLOR_SUPERPERIDOT2, + "SUPERPERIDOT3", // SKINCOLOR_SUPERPERIDOT3, + "SUPERPERIDOT4", // SKINCOLOR_SUPERPERIDOT4, + "SUPERPERIDOT5", // SKINCOLOR_SUPERPERIDOT5, - "SUPERCYAN1", // SKINCOLOR_SUPERCYAN1 - "SUPERCYAN2", // SKINCOLOR_SUPERCYAN2, - "SUPERCYAN3", // SKINCOLOR_SUPERCYAN3, - "SUPERCYAN4", // SKINCOLOR_SUPERCYAN4, - "SUPERCYAN5", // SKINCOLOR_SUPERCYAN5, + "SUPERCYAN1", // SKINCOLOR_SUPERCYAN1 + "SUPERCYAN2", // SKINCOLOR_SUPERCYAN2, + "SUPERCYAN3", // SKINCOLOR_SUPERCYAN3, + "SUPERCYAN4", // SKINCOLOR_SUPERCYAN4, + "SUPERCYAN5", // SKINCOLOR_SUPERCYAN5, - "SUPERPURPLE1", // SKINCOLOR_SUPERPURPLE1, - "SUPERPURPLE2", // SKINCOLOR_SUPERPURPLE2, - "SUPERPURPLE3", // SKINCOLOR_SUPERPURPLE3, - "SUPERPURPLE4", // SKINCOLOR_SUPERPURPLE4, - "SUPERPURPLE5", // SKINCOLOR_SUPERPURPLE5, + "SUPERPURPLE1", // SKINCOLOR_SUPERPURPLE1, + "SUPERPURPLE2", // SKINCOLOR_SUPERPURPLE2, + "SUPERPURPLE3", // SKINCOLOR_SUPERPURPLE3, + "SUPERPURPLE4", // SKINCOLOR_SUPERPURPLE4, + "SUPERPURPLE5", // SKINCOLOR_SUPERPURPLE5, - "SUPERRUST1", // SKINCOLOR_SUPERRUST1 - "SUPERRUST2", // SKINCOLOR_SUPERRUST2, - "SUPERRUST3", // SKINCOLOR_SUPERRUST3, - "SUPERRUST4", // SKINCOLOR_SUPERRUST4, - "SUPERRUST5", // SKINCOLOR_SUPERRUST5, + "SUPERRUST1", // SKINCOLOR_SUPERRUST1 + "SUPERRUST2", // SKINCOLOR_SUPERRUST2, + "SUPERRUST3", // SKINCOLOR_SUPERRUST3, + "SUPERRUST4", // SKINCOLOR_SUPERRUST4, + "SUPERRUST5", // SKINCOLOR_SUPERRUST5, - "SUPERTAN1", // SKINCOLOR_SUPERTAN1 - "SUPERTAN2", // SKINCOLOR_SUPERTAN2, - "SUPERTAN3", // SKINCOLOR_SUPERTAN3, - "SUPERTAN4", // SKINCOLOR_SUPERTAN4, - "SUPERTAN5" // SKINCOLOR_SUPERTAN5, + "SUPERTAN1", // SKINCOLOR_SUPERTAN1 + "SUPERTAN2", // SKINCOLOR_SUPERTAN2, + "SUPERTAN3", // SKINCOLOR_SUPERTAN3, + "SUPERTAN4", // SKINCOLOR_SUPERTAN4, + "SUPERTAN5" // SKINCOLOR_SUPERTAN5, }; static const char *const POWERS_LIST[] = { diff --git a/src/doomdata.h b/src/doomdata.h index 033cc71b3..c0586fd65 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -207,8 +207,9 @@ typedef struct #define ZSHIFT 4 +extern const UINT8 Color_Index[MAXTRANSLATIONS-1][16]; extern const char *Color_Names[MAXSKINCOLORS + NUMSUPERCOLORS]; -extern const UINT8 Color_Opposite[MAXSKINCOLORS*2]; +extern const UINT8 Color_Opposite[(MAXSKINCOLORS - 1)*2]; #define NUMMAPS 1035 diff --git a/src/doomdef.h b/src/doomdef.h index 16d7fa218..1d8f99a7a 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -229,39 +229,77 @@ extern FILE *logstream; typedef enum { SKINCOLOR_NONE = 0, + + // Greyscale ranges SKINCOLOR_WHITE, + SKINCOLOR_BONE, SKINCOLOR_SILVER, SKINCOLOR_GREY, + SKINCOLOR_CLOUDY, + SKINCOLOR_CARBON, + SKINCOLOR_JET, SKINCOLOR_BLACK, - SKINCOLOR_BEIGE, - SKINCOLOR_PEACH, + + // Desaturated + SKINCOLOR_AETHER, + SKINCOLOR_SLATE, + SKINCOLOR_PINK, + SKINCOLOR_YOGURT, SKINCOLOR_BROWN, + SKINCOLOR_TAN, + SKINCOLOR_BEIGE, + SKINCOLOR_MOSS, + SKINCOLOR_AZURE, + SKINCOLOR_LAVENDER, + + // Viv's vivid colours (toast 21/07/17) + SKINCOLOR_RUBY, + SKINCOLOR_SALMON, SKINCOLOR_RED, SKINCOLOR_CRIMSON, + SKINCOLOR_FLAME, + SKINCOLOR_PEACHY, + SKINCOLOR_QUAIL, + SKINCOLOR_SUNSET, + SKINCOLOR_APRICOT, SKINCOLOR_ORANGE, SKINCOLOR_RUST, SKINCOLOR_GOLD, + SKINCOLOR_SANDY, SKINCOLOR_YELLOW, - SKINCOLOR_TAN, - SKINCOLOR_MOSS, + SKINCOLOR_OLIVE, + SKINCOLOR_LIME, SKINCOLOR_PERIDOT, SKINCOLOR_GREEN, + SKINCOLOR_FOREST, SKINCOLOR_EMERALD, + SKINCOLOR_MINT, + SKINCOLOR_SEAFOAM, SKINCOLOR_AQUA, SKINCOLOR_TEAL, + SKINCOLOR_WAVE, SKINCOLOR_CYAN, + SKINCOLOR_SKY, + SKINCOLOR_CERULEAN, + SKINCOLOR_ICY, + SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave – slender aphrodite has overcome me with longing for a girl + SKINCOLOR_CORNFLOWER, SKINCOLOR_BLUE, - SKINCOLOR_AZURE, + SKINCOLOR_COBALT, + SKINCOLOR_VAPOR, + SKINCOLOR_DUSK, SKINCOLOR_PASTEL, SKINCOLOR_PURPLE, - SKINCOLOR_LAVENDER, + SKINCOLOR_BUBBLEGUM, SKINCOLOR_MAGENTA, - SKINCOLOR_PINK, + SKINCOLOR_NEON, + SKINCOLOR_VIOLET, + SKINCOLOR_LILAC, + SKINCOLOR_PLUM, SKINCOLOR_ROSY, - //SKINCOLOR_? - //SKINCOLOR_? - // Careful! MAXSKINCOLORS cannot be greater than 0x20! Two slots left... + // SKINCOLOR_? - one left before we bump up against 0x39, which isn't a HARD limit anymore but would be excessive + MAXSKINCOLORS, // Super special awesome Super flashing colors! diff --git a/src/g_game.c b/src/g_game.c index 4ef3d44a8..6e43aeb8b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4514,7 +4514,7 @@ void G_GhostTicker(void) g->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4); break; case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer) - g->mo->color = (UINT8)(SKINCOLOR_RED + (leveltime % (MAXSKINCOLORS - SKINCOLOR_RED))); // Passes through all saturated colours + g->mo->color = (UINT8)(SKINCOLOR_RUBY + (leveltime % (MAXSKINCOLORS - SKINCOLOR_RUBY))); // Passes through all saturated colours break; default: break; diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 7edf02db0..c7d35e913 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -961,244 +961,10 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, image = gpatch->mipmap.grInfo.data; blendimage = blendgpatch->mipmap.grInfo.data; - switch (color) - { - case SKINCOLOR_WHITE: - blendcolor = V_GetColor(3); - break; - case SKINCOLOR_SILVER: - blendcolor = V_GetColor(10); - break; - case SKINCOLOR_GREY: - blendcolor = V_GetColor(15); - break; - case SKINCOLOR_BLACK: - blendcolor = V_GetColor(27); - break; - case SKINCOLOR_BEIGE: - blendcolor = V_GetColor(247); - break; - case SKINCOLOR_PEACH: - blendcolor = V_GetColor(218); - break; - case SKINCOLOR_BROWN: - blendcolor = V_GetColor(234); - break; - case SKINCOLOR_RED: - blendcolor = V_GetColor(38); - break; - case SKINCOLOR_CRIMSON: - blendcolor = V_GetColor(45); - break; - case SKINCOLOR_ORANGE: - blendcolor = V_GetColor(54); - break; - case SKINCOLOR_RUST: - blendcolor = V_GetColor(60); - break; - case SKINCOLOR_GOLD: - blendcolor = V_GetColor(67); - break; - case SKINCOLOR_YELLOW: - blendcolor = V_GetColor(73); - break; - case SKINCOLOR_TAN: - blendcolor = V_GetColor(85); - break; - case SKINCOLOR_MOSS: - blendcolor = V_GetColor(92); - break; - case SKINCOLOR_PERIDOT: - blendcolor = V_GetColor(188); - break; - case SKINCOLOR_GREEN: - blendcolor = V_GetColor(101); - break; - case SKINCOLOR_EMERALD: - blendcolor = V_GetColor(112); - break; - case SKINCOLOR_AQUA: - blendcolor = V_GetColor(122); - break; - case SKINCOLOR_TEAL: - blendcolor = V_GetColor(141); - break; - case SKINCOLOR_CYAN: - blendcolor = V_GetColor(131); - break; - case SKINCOLOR_BLUE: - blendcolor = V_GetColor(152); - break; - case SKINCOLOR_AZURE: - blendcolor = V_GetColor(171); - break; - case SKINCOLOR_PASTEL: - blendcolor = V_GetColor(161); - break; - case SKINCOLOR_PURPLE: - blendcolor = V_GetColor(165); - break; - case SKINCOLOR_LAVENDER: - blendcolor = V_GetColor(195); - break; - case SKINCOLOR_MAGENTA: - blendcolor = V_GetColor(183); - break; - case SKINCOLOR_PINK: - blendcolor = V_GetColor(211); - break; - case SKINCOLOR_ROSY: - blendcolor = V_GetColor(202); - break; - - case SKINCOLOR_SUPERSILVER1: // Super silver - blendcolor = V_GetColor(0); - break; - case SKINCOLOR_SUPERSILVER2: - blendcolor = V_GetColor(2); - break; - case SKINCOLOR_SUPERSILVER3: - blendcolor = V_GetColor(4); - break; - case SKINCOLOR_SUPERSILVER4: - blendcolor = V_GetColor(7); - break; - case SKINCOLOR_SUPERSILVER5: - blendcolor = V_GetColor(10); - break; - - case SKINCOLOR_SUPERRED1: // Super red - blendcolor = V_GetColor(208); - break; - case SKINCOLOR_SUPERRED2: - blendcolor = V_GetColor(210); - break; - case SKINCOLOR_SUPERRED3: - blendcolor = V_GetColor(32); - break; - case SKINCOLOR_SUPERRED4: - blendcolor = V_GetColor(33); - break; - case SKINCOLOR_SUPERRED5: - blendcolor = V_GetColor(35); - break; - - case SKINCOLOR_SUPERORANGE1: // Super orange - blendcolor = V_GetColor(208); - break; - case SKINCOLOR_SUPERORANGE2: - blendcolor = V_GetColor(48); - break; - case SKINCOLOR_SUPERORANGE3: - blendcolor = V_GetColor(50); - break; - case SKINCOLOR_SUPERORANGE4: - blendcolor = V_GetColor(54); - break; - case SKINCOLOR_SUPERORANGE5: - blendcolor = V_GetColor(58); - break; - - case SKINCOLOR_SUPERGOLD1: // Super gold - blendcolor = V_GetColor(80); - break; - case SKINCOLOR_SUPERGOLD2: - blendcolor = V_GetColor(83); - break; - case SKINCOLOR_SUPERGOLD3: - blendcolor = V_GetColor(73); - break; - case SKINCOLOR_SUPERGOLD4: - blendcolor = V_GetColor(64); - break; - case SKINCOLOR_SUPERGOLD5: - blendcolor = V_GetColor(67); - break; - - case SKINCOLOR_SUPERPERIDOT1: // Super peridot - blendcolor = V_GetColor(88); - break; - case SKINCOLOR_SUPERPERIDOT2: - blendcolor = V_GetColor(188); - break; - case SKINCOLOR_SUPERPERIDOT3: - blendcolor = V_GetColor(189); - break; - case SKINCOLOR_SUPERPERIDOT4: - blendcolor = V_GetColor(190); - break; - case SKINCOLOR_SUPERPERIDOT5: - blendcolor = V_GetColor(191); - break; - - case SKINCOLOR_SUPERCYAN1: // Super cyan - blendcolor = V_GetColor(128); - break; - case SKINCOLOR_SUPERCYAN2: - blendcolor = V_GetColor(131); - break; - case SKINCOLOR_SUPERCYAN3: - blendcolor = V_GetColor(133); - break; - case SKINCOLOR_SUPERCYAN4: - blendcolor = V_GetColor(134); - break; - case SKINCOLOR_SUPERCYAN5: - blendcolor = V_GetColor(136); - break; - - case SKINCOLOR_SUPERPURPLE1: // Super purple - blendcolor = V_GetColor(144); - break; - case SKINCOLOR_SUPERPURPLE2: - blendcolor = V_GetColor(162); - break; - case SKINCOLOR_SUPERPURPLE3: - blendcolor = V_GetColor(164); - break; - case SKINCOLOR_SUPERPURPLE4: - blendcolor = V_GetColor(166); - break; - case SKINCOLOR_SUPERPURPLE5: - blendcolor = V_GetColor(168); - break; - - case SKINCOLOR_SUPERRUST1: // Super rust - blendcolor = V_GetColor(51); - break; - case SKINCOLOR_SUPERRUST2: - blendcolor = V_GetColor(54); - break; - case SKINCOLOR_SUPERRUST3: - blendcolor = V_GetColor(68); - break; - case SKINCOLOR_SUPERRUST4: - blendcolor = V_GetColor(70); - break; - case SKINCOLOR_SUPERRUST5: - blendcolor = V_GetColor(234); - break; - - case SKINCOLOR_SUPERTAN1: // Super tan - blendcolor = V_GetColor(80); - break; - case SKINCOLOR_SUPERTAN2: - blendcolor = V_GetColor(82); - break; - case SKINCOLOR_SUPERTAN3: - blendcolor = V_GetColor(84); - break; - case SKINCOLOR_SUPERTAN4: - blendcolor = V_GetColor(87); - break; - case SKINCOLOR_SUPERTAN5: - blendcolor = V_GetColor(247); - break; - - default: - blendcolor = V_GetColor(255); - break; - } + if (color == SKINCOLOR_NONE || color >= MAXTRANSLATIONS) + blendcolor = V_GetColor(0xff); + else + blendcolor = V_GetColor(Color_Index[color-1][4]); while (size--) { diff --git a/src/p_enemy.c b/src/p_enemy.c index ee18985aa..80349a645 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -4208,12 +4208,12 @@ void A_SignPlayer(mobj_t *actor) of in the name. If you have a better idea, feel free to let me know. ~toast 2016/07/20 */ - actor->frame += Color_Opposite[Color_Opposite[skin->prefoppositecolor*2]*2+1]; + actor->frame += (15 - Color_Opposite[(Color_Opposite[(skin->prefoppositecolor - 1)*2] - 1)*2 + 1]); } - else // Set the sign to be an appropriate background color for this player's skincolor. + else if (actor->target->player->skincolor) // Set the sign to be an appropriate background color for this player's skincolor. { - actor->color = Color_Opposite[actor->target->player->skincolor*2]; - actor->frame += Color_Opposite[actor->target->player->skincolor*2+1]; + actor->color = Color_Opposite[(actor->target->player->skincolor - 1)*2]; + actor->frame += (15 - Color_Opposite[(actor->target->player->skincolor - 1)*2 + 1]); } if (skin->sprites[SPR2_SIGN].numframes) diff --git a/src/p_user.c b/src/p_user.c index 5506925e0..adaa78ed4 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2280,7 +2280,7 @@ static void P_CheckInvincibilityTimer(player_t *player) return; if (mariomode && !player->powers[pw_super]) - player->mo->color = (UINT8)(SKINCOLOR_RED + (leveltime % (MAXSKINCOLORS - SKINCOLOR_RED))); // Passes through all saturated colours + player->mo->color = (UINT8)(SKINCOLOR_RUBY + (leveltime % (MAXSKINCOLORS - SKINCOLOR_RUBY))); // Passes through all saturated colours else if (leveltime % (TICRATE/7) == 0) { mobj_t *sparkle = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_IVSP); diff --git a/src/r_draw.c b/src/r_draw.c index 30b60a0e0..a884cdf1f 100644 --- a/src/r_draw.c +++ b/src/r_draw.c @@ -126,47 +126,214 @@ UINT32 nflatxshift, nflatyshift, nflatshiftup, nflatmask; #define BOSS_TT_CACHE_INDEX (MAXSKINS + 1) #define METALSONIC_TT_CACHE_INDEX (MAXSKINS + 2) #define ALLWHITE_TT_CACHE_INDEX (MAXSKINS + 3) -#define SKIN_RAMP_LENGTH 16 #define DEFAULT_STARTTRANSCOLOR 96 #define NUM_PALETTE_ENTRIES 256 static UINT8** translationtablecache[MAXSKINS + 4] = {NULL}; +const UINT8 Color_Index[MAXTRANSLATIONS-1][16] = { + // {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, // SKINCOLOR_NONE + + // Greyscale ranges + {0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x11}, // SKINCOLOR_WHITE + {0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x11, 0x12}, // SKINCOLOR_BONE + {0x02, 0x03, 0x04, 0x05, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14}, // SKINCOLOR_SILVER + {0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18}, // SKINCOLOR_GREY + {0x02, 0x03, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0f, 0x11, 0x13, 0x15, 0x17, 0x19, 0x1b, 0x1d, 0x1f}, // SKINCOLOR_CLOUDY + {0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x16, 0x17, 0x17, 0x19, 0x19, 0x1a, 0x1a, 0x1b, 0x1c, 0x1d}, // SKINCOLOR_CARBON + {0x00, 0x05, 0x0a, 0x0f, 0x14, 0x19, 0x1a, 0x1b, 0x1c, 0x1e, 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f}, // SKINCOLOR_JET + {0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1b, 0x1b, 0x1c, 0x1d, 0x1d, 0x1e, 0x1e, 0x1f, 0x1f}, // SKINCOLOR_BLACK + + // Desaturated + {0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x91, 0x91, 0x91, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xaf}, // SKINCOLOR_AETHER + {0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0xaa, 0xaa, 0xaa, 0xab, 0xac, 0xac, 0xad, 0xad, 0xae, 0xaf}, // SKINCOLOR_SLATE + {0xd0, 0xd0, 0xd1, 0xd1, 0xd2, 0xd2, 0xd3, 0xd3, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0x2b, 0x2c, 0x2e}, // SKINCOLOR_PINK + {0xd0, 0x30, 0xd8, 0xd9, 0xda, 0xdb, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe3, 0xe6, 0xe8, 0xe9}, // SKINCOLOR_YOGURT + {0xdf, 0xe0, 0xe1, 0xe2, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef}, // SKINCOLOR_BROWN + {0x51, 0x51, 0x54, 0x54, 0x55, 0x55, 0x56, 0x56, 0x56, 0x57, 0xf5, 0xf5, 0xf9, 0xf9, 0xed, 0xed}, // SKINCOLOR_TAN + {0x54, 0x55, 0x56, 0x56, 0xf2, 0xf3, 0xf3, 0xf4, 0xf5, 0xf6, 0xf8, 0xf9, 0xfa, 0xfb, 0xed, 0xed}, // SKINCOLOR_BEIGE + {0x58, 0x58, 0x59, 0x59, 0x5a, 0x5a, 0x5b, 0x5b, 0x5b, 0x5c, 0x5d, 0x5d, 0x5e, 0x5e, 0x5f, 0x5f}, // SKINCOLOR_MOSS + {0x90, 0x90, 0x91, 0x91, 0xaa, 0xaa, 0xab, 0xab, 0xab, 0xac, 0xad, 0xad, 0xae, 0xae, 0xaf, 0xaf}, // SKINCOLOR_AZURE + {0xc0, 0xc0, 0xc1, 0xc1, 0xc2, 0xc2, 0xc3, 0xc3, 0xc3, 0xc4, 0xc5, 0xc5, 0xc6, 0xc6, 0xc7, 0xc7}, // SKINCOLOR_LAVENDER + + // Viv's vivid colours (toast 21/07/17) + {0xb0, 0xb0, 0xc9, 0xca, 0xcc, 0x26, 0x27, 0x28, 0x29, 0x2a, 0xb9, 0xb9, 0xba, 0xba, 0xbb, 0xfd}, // SKINCOLOR_RUBY + {0xd0, 0xd0, 0xd1, 0xd2, 0x20, 0x21, 0x24, 0x25, 0x26, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e}, // SKINCOLOR_SALMON + {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x47, 0x2e, 0x2f}, // SKINCOLOR_RED + {0x27, 0x27, 0x28, 0x28, 0x29, 0x2a, 0x2b, 0x2b, 0x2c, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f, 0x1f}, // SKINCOLOR_CRIMSON + {0x31, 0x32, 0x33, 0x36, 0x22, 0x22, 0x25, 0x25, 0x25, 0xcd, 0xcf, 0xcf, 0xc5, 0xc5, 0xc7, 0xc7}, // SKINCOLOR_FLAME + {0xd0, 0x30, 0x31, 0x31, 0x32, 0x32, 0xdc, 0xdc, 0xdc, 0xd3, 0xd4, 0xd4, 0xcc, 0xcd, 0xce, 0xcf}, // SKINCOLOR_PEACHY + {0xd8, 0xd9, 0xdb, 0xdc, 0xde, 0xdf, 0xd5, 0xd5, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0x1d, 0x1f}, // SKINCOLOR_QUAIL + {0x51, 0x52, 0x40, 0x40, 0x34, 0x36, 0xd5, 0xd5, 0xd6, 0xd7, 0xcf, 0xcf, 0xc6, 0xc6, 0xc7, 0xfe}, // SKINCOLOR_SUNSET + {0x00, 0xd8, 0xd9, 0xda, 0xdb, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e}, // SKINCOLOR_APRICOT + {0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x2c}, // SKINCOLOR_ORANGE + {0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3f, 0x2c, 0x2d, 0x47, 0x2e, 0x2f, 0x2f}, // SKINCOLOR_RUST + {0x51, 0x51, 0x54, 0x54, 0x41, 0x42, 0x43, 0x43, 0x44, 0x45, 0x46, 0x3f, 0x2d, 0x2e, 0x2f, 0x2f}, // SKINCOLOR_GOLD + {0x53, 0x40, 0x41, 0x42, 0x43, 0xe6, 0xe9, 0xe9, 0xea, 0xec, 0xec, 0xc6, 0xc6, 0xc7, 0xc7, 0xfe}, // SKINCOLOR_SANDY + {0x52, 0x53, 0x49, 0x49, 0x4a, 0x4a, 0x4b, 0x4b, 0x4b, 0x4c, 0x4d, 0x4d, 0x4e, 0x4e, 0x4f, 0xed}, // SKINCOLOR_YELLOW + {0x4b, 0x4b, 0x4c, 0x4c, 0x4d, 0x4e, 0xe7, 0xe7, 0xe9, 0xc5, 0xc5, 0xc6, 0xc6, 0xc7, 0xc7, 0xfd}, // SKINCOLOR_OLIVE + {0x50, 0x51, 0x52, 0x53, 0x48, 0xbc, 0xbd, 0xbe, 0xbe, 0xbf, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f}, // SKINCOLOR_LIME + {0x58, 0x58, 0xbc, 0xbc, 0xbd, 0xbd, 0xbe, 0xbe, 0xbe, 0xbf, 0x5e, 0x5e, 0x5f, 0x5f, 0x77, 0x77}, // SKINCOLOR_PERIDOT + {0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f}, // SKINCOLOR_GREEN + {0x65, 0x66, 0x67, 0x68, 0x69, 0x69, 0x6a, 0x6b, 0x6b, 0x6c, 0x6d, 0x6d, 0x6e, 0x6e, 0x6e, 0x6f}, // SKINCOLOR_FOREST + {0x70, 0x70, 0x71, 0x71, 0x72, 0x72, 0x73, 0x73, 0x73, 0x74, 0x75, 0x75, 0x76, 0x76, 0x77, 0x77}, // SKINCOLOR_EMERALD + {0x00, 0x00, 0x58, 0x58, 0x59, 0x62, 0x62, 0x62, 0x64, 0x67, 0x7e, 0x7e, 0x8f, 0x8f, 0x8a, 0x8a}, // SKINCOLOR_MINT + {0x01, 0x58, 0x59, 0x5a, 0x7d, 0x7d, 0x7e, 0x7e, 0x7e, 0x8f, 0x8f, 0x8a, 0x8a, 0x8a, 0xfd, 0xfd}, // SKINCOLOR_SEAFOAM + {0x78, 0x79, 0x7a, 0x7a, 0x7b, 0x7b, 0x7c, 0x7c, 0x7c, 0x7d, 0x7e, 0x7e, 0x7f, 0x7f, 0x76, 0x77}, // SKINCOLOR_AQUA + {0x78, 0x78, 0x8c, 0x8c, 0x8d, 0x8d, 0x8d, 0x8e, 0x8e, 0x8f, 0x8f, 0x8f, 0x8a, 0x8a, 0x8a, 0x8a}, // SKINCOLOR_TEAL + {0x00, 0x78, 0x78, 0x79, 0x8d, 0x87, 0x88, 0x89, 0x89, 0xae, 0xa8, 0xa8, 0xa9, 0xa9, 0xfd, 0xfd}, // SKINCOLOR_WAVE + {0x80, 0x81, 0xff, 0xff, 0x83, 0x83, 0x8d, 0x8d, 0x8d, 0x8e, 0x7e, 0x7f, 0x76, 0x76, 0x77, 0x6e}, // SKINCOLOR_CYAN + {0x80, 0x80, 0x81, 0x82, 0x83, 0x83, 0x84, 0x85, 0x85, 0x86, 0x87, 0x88, 0x89, 0x89, 0x8a, 0x8b}, // SKINCOLOR_SKY + {0x85, 0x86, 0x87, 0x88, 0x88, 0x89, 0x89, 0x89, 0x8a, 0x8a, 0xfd, 0xfd, 0xfd, 0x1f, 0x1f, 0x1f}, // SKINCOLOR_CERULEAN + {0x00, 0x00, 0x00, 0x00, 0x80, 0x81, 0x83, 0x83, 0x86, 0x87, 0x95, 0x95, 0xad, 0xad, 0xae, 0xaf}, // SKINCOLOR_ICY + {0x80, 0x83, 0x86, 0x87, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xfd, 0xfe}, // SKINCOLOR_SAPPHIRE + {0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x9a, 0x9c, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e}, // SKINCOLOR_CORNFLOWER + {0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xfd, 0xfe}, // SKINCOLOR_BLUE + {0x93, 0x94, 0x95, 0x96, 0x98, 0x9a, 0x9b, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xfd, 0xfd, 0xfe, 0xfe}, // SKINCOLOR_COBALT + {0x80, 0x81, 0x83, 0x86, 0x94, 0x94, 0xa3, 0xa3, 0xa4, 0xa6, 0xa6, 0xa6, 0xa8, 0xa8, 0xa9, 0xa9}, // SKINCOLOR_VAPOR + {0x92, 0x93, 0x94, 0x94, 0xac, 0xad, 0xad, 0xad, 0xae, 0xae, 0xaf, 0xaf, 0xa9, 0xa9, 0xfd, 0xfd}, // SKINCOLOR_DUSK + {0x90, 0x90, 0xa0, 0xa0, 0xa1, 0xa1, 0xa2, 0xa2, 0xa2, 0xa3, 0xa4, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8}, // SKINCOLOR_PASTEL + {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa4, 0xa5, 0xa5, 0xa5, 0xa6, 0xa7, 0xa7, 0xa8, 0xa8, 0xa9, 0xa9}, // SKINCOLOR_PURPLE + {0x00, 0xd0, 0xd0, 0xc8, 0xc8, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8}, // SKINCOLOR_BUBBLEGUM + {0xb3, 0xb3, 0xb4, 0xb5, 0xb6, 0xb6, 0xb7, 0xb7, 0xb7, 0xb8, 0xb9, 0xb9, 0xba, 0xba, 0xbb, 0xbb}, // SKINCOLOR_MAGENTA + {0xb3, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xb9, 0xba, 0xba, 0xbb, 0xbb, 0xc7, 0xc7, 0x1d, 0x1d, 0x1e}, // SKINCOLOR_NEON + {0xd0, 0xd1, 0xd2, 0xca, 0xcc, 0xb8, 0xb9, 0xb9, 0xba, 0xa8, 0xa8, 0xa9, 0xa9, 0xfd, 0xfe, 0xfe}, // SKINCOLOR_VIOLET + {0x00, 0xd0, 0xd1, 0xd2, 0xd3, 0xc1, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc5, 0xc6, 0xc6, 0xfe, 0x1f}, // SKINCOLOR_LILAC + {0xc8, 0xd3, 0xd5, 0xd6, 0xd7, 0xce, 0xcf, 0xb9, 0xb9, 0xba, 0xba, 0xa9, 0xa9, 0xa9, 0xfd, 0xfe}, // SKINCOLOR_PLUM + {0xfc, 0xc8, 0xc8, 0xc9, 0xc9, 0xca, 0xca, 0xcb, 0xcb, 0xcc, 0xcc, 0xcd, 0xcd, 0xce, 0xce, 0xcf}, // SKINCOLOR_ROSY + + // {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, // SKINCOLOR_? + + // super + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x03}, // SKINCOLOR_SUPERSILVER1 + {0x00, 0x01, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x07}, // SKINCOLOR_SUPERSILVER2 + {0x01, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x07, 0x09, 0x0b}, // SKINCOLOR_SUPERSILVER3 + {0x02, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0f, 0x11}, // SKINCOLOR_SUPERSILVER4 + {0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0f, 0x11, 0x13}, // SKINCOLOR_SUPERSILVER5 + + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xd0, 0xd1, 0xd1, 0xd2, 0xd2}, // SKINCOLOR_SUPERRED1 + {0x00, 0x00, 0x00, 0xd0, 0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2, 0x20, 0x20, 0x21, 0x21}, // SKINCOLOR_SUPERRED2 + {0x00, 0x00, 0xd0, 0xd0, 0xd1, 0xd1, 0xd2, 0xd2, 0x20, 0x20, 0x21, 0x21, 0x22, 0x22, 0x23, 0x23}, // SKINCOLOR_SUPERRED3 + {0x00, 0xd0, 0xd1, 0xd1, 0xd2, 0xd2, 0x20, 0x20, 0x21, 0x21, 0x22, 0x22, 0x23, 0x23, 0x24, 0x24}, // SKINCOLOR_SUPERRED4 + {0xd0, 0xd1, 0xd2, 0xd2, 0x20, 0x20, 0x21, 0x21, 0x22, 0x22, 0x23, 0x23, 0x24, 0x24, 0x25, 0x25}, // SKINCOLOR_SUPERRED5 + + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x30, 0x31, 0x32, 0x33, 0x34}, // SKINCOLOR_SUPERORANGE1 + {0x00, 0x00, 0x00, 0x00, 0xd0, 0xd0, 0x30, 0x30, 0x31, 0x31, 0x32, 0x32, 0x33, 0x33, 0x34, 0x34}, // SKINCOLOR_SUPERORANGE2 + {0x00, 0x00, 0xd0, 0xd0, 0x30, 0x30, 0x31, 0x31, 0x32, 0x32, 0x33, 0x33, 0x34, 0x34, 0x35, 0x35}, // SKINCOLOR_SUPERORANGE3 + {0x00, 0xd0, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x44, 0x45, 0x46}, // SKINCOLOR_SUPERORANGE4 + {0xd0, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x44, 0x45, 0x46, 0x47}, // SKINCOLOR_SUPERORANGE5 + + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x50, 0x51, 0x52, 0x53, 0x48}, // SKINCOLOR_SUPERGOLD1 + {0x00, 0x50, 0x51, 0x52, 0x53, 0x53, 0x48, 0x48, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49, 0x40, 0x41}, // SKINCOLOR_SUPERGOLD2 + {0x51, 0x52, 0x53, 0x53, 0x48, 0x48, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49, 0x40, 0x41, 0x42, 0x43}, // SKINCOLOR_SUPERGOLD3 + {0x53, 0x48, 0x48, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46}, // SKINCOLOR_SUPERGOLD4 + {0x48, 0x48, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47}, // SKINCOLOR_SUPERGOLD5 + + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x58, 0x58, 0xbc, 0xbc, 0xbc}, // SKINCOLOR_SUPERPERIDOT1 + {0x00, 0x58, 0x58, 0x58, 0xbc, 0xbc, 0xbc, 0xbc, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbe, 0xbe}, // SKINCOLOR_SUPERPERIDOT2 + {0x58, 0x58, 0xbc, 0xbc, 0xbc, 0xbc, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbe, 0xbe, 0xbf, 0xbf}, // SKINCOLOR_SUPERPERIDOT3 + {0x58, 0xbc, 0xbc, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbe, 0xbe, 0xbf, 0xbf, 0x5e, 0x5e, 0x5f}, // SKINCOLOR_SUPERPERIDOT4 + {0xbc, 0xbc, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbe, 0xbe, 0xbf, 0xbf, 0x5e, 0x5e, 0x5f, 0x77}, // SKINCOLOR_SUPERPERIDOT5 + + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x81, 0x82, 0x83, 0x84}, // SKINCOLOR_SUPERCYAN1 + {0x00, 0x80, 0x81, 0x82, 0x83, 0x83, 0x84, 0x84, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x86, 0x86}, // SKINCOLOR_SUPERCYAN2 + {0x81, 0x82, 0x83, 0x83, 0x84, 0x84, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x86, 0x86, 0x87, 0x87}, // SKINCOLOR_SUPERCYAN3 + {0x83, 0x84, 0x84, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x86, 0x86, 0x87, 0x87, 0x88, 0x89, 0x8a}, // SKINCOLOR_SUPERCYAN4 + {0x84, 0x84, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x86, 0x86, 0x87, 0x87, 0x88, 0x89, 0x8a, 0x8b}, // SKINCOLOR_SUPERCYAN5 + + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90, 0xa0, 0xa0, 0xa1, 0xa2}, // SKINCOLOR_SUPERPURPLE1 + {0x00, 0x90, 0xa0, 0xa0, 0xa1, 0xa1, 0xa2, 0xa2, 0xa3, 0xa3, 0xa3, 0xa3, 0xa4, 0xa4, 0xa5, 0xa5}, // SKINCOLOR_SUPERPURPLE2 + {0xa0, 0xa0, 0xa1, 0xa1, 0xa2, 0xa2, 0xa3, 0xa3, 0xa3, 0xa3, 0xa4, 0xa4, 0xa5, 0xa5, 0xa6, 0xa6}, // SKINCOLOR_SUPERPURPLE3 + {0xa1, 0xa2, 0xa2, 0xa3, 0xa3, 0xa3, 0xa3, 0xa4, 0xa4, 0xa5, 0xa5, 0xa6, 0xa6, 0xa7, 0xa8, 0xa9}, // SKINCOLOR_SUPERPURPLE4 + {0xa2, 0xa2, 0xa3, 0xa3, 0xa3, 0xa3, 0xa4, 0xa4, 0xa5, 0xa5, 0xa6, 0xa6, 0xa7, 0xa8, 0xa9, 0xfd}, // SKINCOLOR_SUPERPURPLE5 + + {0x00, 0xd0, 0xd0, 0xd0, 0x30, 0x30, 0x31, 0x32, 0x33, 0x37, 0x3a, 0x44, 0x45, 0x46, 0x47, 0x2e}, // SKINCOLOR_SUPERRUST1 + {0x30, 0x31, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x38, 0x3a, 0x44, 0x45, 0x46, 0x47, 0x47, 0x2e}, // SKINCOLOR_SUPERRUST2 + {0x31, 0x32, 0x33, 0x34, 0x36, 0x37, 0x38, 0x3a, 0x44, 0x45, 0x45, 0x46, 0x46, 0x47, 0x2e, 0x2e}, // SKINCOLOR_SUPERRUST3 + {0x48, 0x40, 0x41, 0x42, 0x43, 0x44, 0x44, 0x45, 0x45, 0x46, 0x46, 0x47, 0x47, 0x2e, 0x2e, 0x2e}, // SKINCOLOR_SUPERRUST4 + {0x41, 0x42, 0x43, 0x43, 0x44, 0x44, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xed, 0xee, 0xee, 0xef, 0xef}, // SKINCOLOR_SUPERRUST5 + + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x50, 0x51, 0x51, 0x52, 0x52}, // SKINCOLOR_SUPERTAN1 + {0x00, 0x50, 0x50, 0x51, 0x51, 0x52, 0x52, 0x52, 0x54, 0x54, 0x54, 0x54, 0x55, 0x56, 0x57, 0xf5}, // SKINCOLOR_SUPERTAN2 + {0x50, 0x51, 0x51, 0x52, 0x52, 0x52, 0x54, 0x54, 0x54, 0x54, 0x55, 0x56, 0x57, 0xf5, 0xf7, 0xf9}, // SKINCOLOR_SUPERTAN3 + {0x51, 0x52, 0x52, 0x52, 0x52, 0x54, 0x54, 0x54, 0x55, 0x56, 0x57, 0xf5, 0xf7, 0xf9, 0xfb, 0xed}, // SKINCOLOR_SUPERTAN4 + {0x52, 0x52, 0x54, 0x54, 0x54, 0x55, 0x56, 0x57, 0xf5, 0xf7, 0xf9, 0xfb, 0xed, 0xee, 0xef, 0xef} // SKINCOLOR_SUPERTAN5 +}; // See also the enum skincolors_t // TODO Callum: Can this be translated? const char *Color_Names[MAXSKINCOLORS + NUMSUPERCOLORS] = { - "None", // SKINCOLOR_NONE - "White", // SKINCOLOR_WHITE - "Silver", // SKINCOLOR_SILVER - "Grey", // SKINCOLOR_GREY - "Black", // SKINCOLOR_BLACK - "Beige", // SKINCOLOR_BEIGE - "Peach", // SKINCOLOR_PEACH - "Brown", // SKINCOLOR_BROWN - "Red", // SKINCOLOR_RED - "Crimson", // SKINCOLOR_CRIMSON - "Orange", // SKINCOLOR_ORANGE - "Rust", // SKINCOLOR_RUST - "Gold", // SKINCOLOR_GOLD - "Yellow", // SKINCOLOR_YELLOW - "Tan", // SKINCOLOR_TAN - "Moss", // SKINCOLOR_MOSS - "Peridot", // SKINCOLOR_PERIDOT - "Green", // SKINCOLOR_GREEN - "Emerald", // SKINCOLOR_EMERALD - "Aqua", // SKINCOLOR_AQUA - "Teal", // SKINCOLOR_TEAL - "Cyan", // SKINCOLOR_CYAN - "Blue", // SKINCOLOR_BLUE - "Azure", // SKINCOLOR_AZURE - "Pastel", // SKINCOLOR_PASTEL - "Purple", // SKINCOLOR_PURPLE - "Lavender", // SKINCOLOR_LAVENDER - "Magenta", // SKINCOLOR_MAGENTA - "Pink", // SKINCOLOR_PINK - "Rosy", // SKINCOLOR_ROSY + "None", // SKINCOLOR_NONE, + + // Greyscale ranges + "White", // SKINCOLOR_WHITE, + "Bone", // SKINCOLOR_BONE, + "Siler", // SKINCOLOR_SILVER, + "Grey", // SKINCOLOR_GREY, + "Cloudy", // SKINCOLOR_CLOUDY, + "Carbon", // SKINCOLOR_CARBON, + "Jet", // SKINCOLOR_JET, + "Black", // SKINCOLOR_BLACK, + + // Desaturated + "Aether", // SKINCOLOR_AETHER, + "Slate", // SKINCOLOR_SLATE, + "Pink", // SKINCOLOR_PINK, + "Yogurt", // SKINCOLOR_YOGURT, + "Brown", // SKINCOLOR_BROWN, + "Tan", // SKINCOLOR_TAN, + "Beige", // SKINCOLOR_BEIGE, + "Moss", // SKINCOLOR_MOSS, + "Azure", // SKINCOLOR_AZURE, + "Lavender", // SKINCOLOR_LAVENDER, + + // Viv's vivid colours (toast 21/07/17) + "Ruby", // SKINCOLOR_RUBY, + "Salmon", // SKINCOLOR_SALMON, + "Red", // SKINCOLOR_RED, + "Crimson", // SKINCOLOR_CRIMSON, + "Flame", // SKINCOLOR_FLAME, + "Peachy", // SKINCOLOR_PEACHY, + "Quail", // SKINCOLOR_QUAIL, + "Sunset", // SKINCOLOR_SUNSET, + "Apricot", // SKINCOLOR_APRICOT, + "Orange", // SKINCOLOR_ORANGE, + "Rust", // SKINCOLOR_RUST, + "Gold", // SKINCOLOR_GOLD, + "Sandy", // SKINCOLOR_SANDY, + "Yellow", // SKINCOLOR_YELLOW, + "Olive", // SKINCOLOR_OLIVE, + "Lime", // SKINCOLOR_LIME, + "Peridot", // SKINCOLOR_PERIDOT, + "Green", // SKINCOLOR_GREEN, + "Forest", // SKINCOLOR_FOREST, + "Emerald", // SKINCOLOR_EMERALD, + "Mint", // SKINCOLOR_MINT, + "Seafoam", // SKINCOLOR_SEAFOAM, + "Aqua", // SKINCOLOR_AQUA, + "Teal", // SKINCOLOR_TEAL, + "Wave", // SKINCOLOR_WAVE, + "Cyan", // SKINCOLOR_CYAN, + "Sky", // SKINCOLOR_SKY, + "Cerulean", // SKINCOLOR_CERULEAN, + "Icy", // SKINCOLOR_ICY, + "Sapphire", // SKINCOLOR_SAPPHIRE, + "Cornflower", // SKINCOLOR_CORNFLOWER, + "Blue", // SKINCOLOR_BLUE, + "Cobalt", // SKINCOLOR_COBALT, + "Vapor", // SKINCOLOR_VAPOR, + "Dusk", // SKINCOLOR_DUSK, + "Pastel", // SKINCOLOR_PASTEL, + "Purple", // SKINCOLOR_PURPLE, + "Bubblegum", // SKINCOLOR_BUBBLEGUM, + "Magenta", // SKINCOLOR_MAGENTA, + "Neon", // SKINCOLOR_NEON, + "Violet", // SKINCOLOR_VIOLET, + "Lilac", // SKINCOLOR_LILAC, + "Plum", // SKINCOLOR_PLUM, + "Rosy", // SKINCOLOR_ROSY, + // Super behaves by different rules (one name per 5 colours), and will be accessed exclusively via R_GetSuperColorByName instead of R_GetColorByName. "Silver", // SKINCOLOR_SUPERSILVER1 "Red", // SKINCOLOR_SUPERRED1 @@ -183,38 +350,77 @@ const char *Color_Names[MAXSKINCOLORS + NUMSUPERCOLORS] = A word of warning: If the following array is non-symmetrical, A_SignPlayer's prefoppositecolor behaviour will break. */ -const UINT8 Color_Opposite[MAXSKINCOLORS*2] = +const UINT8 Color_Opposite[(MAXSKINCOLORS - 1)*2] = { - SKINCOLOR_NONE,8, // SKINCOLOR_NONE - SKINCOLOR_BLACK,10, // SKINCOLOR_WHITE - SKINCOLOR_GREY,4, // SKINCOLOR_SILVER - SKINCOLOR_SILVER,12, // SKINCOLOR_GREY - SKINCOLOR_WHITE,8, // SKINCOLOR_BLACK - SKINCOLOR_BEIGE,8, // SKINCOLOR_BEIGE - needs new offset - SKINCOLOR_BROWN,8, // SKINCOLOR_PEACH - ditto - SKINCOLOR_PEACH,8, // SKINCOLOR_BROWN - ditto - SKINCOLOR_GREEN,5, // SKINCOLOR_RED - SKINCOLOR_CYAN,8, // SKINCOLOR_CRIMSON - ditto - SKINCOLOR_BLUE,11, // SKINCOLOR_ORANGE - SKINCOLOR_TAN,8, // SKINCOLOR_RUST - ditto - SKINCOLOR_LAVENDER,8, // SKINCOLOR_GOLD - SKINCOLOR_TEAL,8, // SKINCOLOR_YELLOW - ditto - SKINCOLOR_RUST,8, // SKINCOLOR_TAN - ditto - SKINCOLOR_MAGENTA,3, // SKINCOLOR_MOSS - SKINCOLOR_PURPLE,8, // SKINCOLOR_PERIDOT - ditto - SKINCOLOR_RED,11, // SKINCOLOR_GREEN - SKINCOLOR_PASTEL,8, // SKINCOLOR_EMERALD - ditto - SKINCOLOR_ROSY,8, // SKINCOLOR_AQUA - ditto - SKINCOLOR_YELLOW,8, // SKINCOLOR_TEAL - ditto - SKINCOLOR_CRIMSON,8, // SKINCOLOR_CYAN - ditto - SKINCOLOR_ORANGE,9, // SKINCOLOR_BLUE - SKINCOLOR_PINK,8, // SKINCOLOR_AZURE - ditto - SKINCOLOR_EMERALD,8, // SKINCOLOR_PASTEL - ditto - SKINCOLOR_PERIDOT,10, // SKINCOLOR_PURPLE - SKINCOLOR_GOLD,10, // SKINCOLOR_LAVENDER - SKINCOLOR_MOSS,8, // SKINCOLOR_MAGENTA - ditto - SKINCOLOR_AZURE,8, // SKINCOLOR_PINK - ditto - SKINCOLOR_AQUA,14 // SKINCOLOR_ROSY + // SKINCOLOR_NONE,8, // SKINCOLOR_NONE + + // Greyscale ranges + SKINCOLOR_BLACK,5, // SKINCOLOR_WHITE, + SKINCOLOR_JET,7, // SKINCOLOR_BONE, + SKINCOLOR_CARBON,7, // SKINCOLOR_SILVER, + SKINCOLOR_AETHER,12, // SKINCOLOR_GREY, + SKINCOLOR_SLATE,12, // SKINCOLOR_CLOUDY, + SKINCOLOR_SILVER,7, // SKINCOLOR_CARBON, + SKINCOLOR_BONE,7, // SKINCOLOR_JET, + SKINCOLOR_WHITE,7, // SKINCOLOR_BLACK, + + // Desaturated + SKINCOLOR_GREY,15, // SKINCOLOR_AETHER, + SKINCOLOR_CLOUDY,12, // SKINCOLOR_SLATE, + SKINCOLOR_AZURE,9, // SKINCOLOR_PINK, + SKINCOLOR_RUST,7, // SKINCOLOR_YOGURT, + SKINCOLOR_TAN,2, // SKINCOLOR_BROWN, + SKINCOLOR_BROWN,12, // SKINCOLOR_TAN, + SKINCOLOR_MOSS,5, // SKINCOLOR_BEIGE, + SKINCOLOR_BEIGE,13, // SKINCOLOR_MOSS, + SKINCOLOR_PINK,5, // SKINCOLOR_AZURE, + SKINCOLOR_GOLD,4, // SKINCOLOR_LAVENDER, + + // Viv's vivid colours (toast 21/07/17) + SKINCOLOR_EMERALD,10, // SKINCOLOR_RUBY, + SKINCOLOR_FOREST,6, // SKINCOLOR_SALMON, + SKINCOLOR_GREEN,10, // SKINCOLOR_RED, + SKINCOLOR_ICY,10, // SKINCOLOR_CRIMSON, + SKINCOLOR_PURPLE,8, // SKINCOLOR_FLAME, + SKINCOLOR_TEAL,7, // SKINCOLOR_PEACHY, + SKINCOLOR_WAVE,5, // SKINCOLOR_QUAIL, + SKINCOLOR_SAPPHIRE,5, // SKINCOLOR_SUNSET, + SKINCOLOR_CYAN,4, // SKINCOLOR_APRICOT, + SKINCOLOR_BLUE,4, // SKINCOLOR_ORANGE, + SKINCOLOR_YOGURT,8, // SKINCOLOR_RUST, + SKINCOLOR_LAVENDER,10, // SKINCOLOR_GOLD, + SKINCOLOR_SKY,8, // SKINCOLOR_SANDY, + SKINCOLOR_CORNFLOWER,8, // SKINCOLOR_YELLOW, + SKINCOLOR_DUSK,3, // SKINCOLOR_OLIVE, + SKINCOLOR_MAGENTA,9, // SKINCOLOR_LIME, + SKINCOLOR_COBALT,2, // SKINCOLOR_PERIDOT, + SKINCOLOR_RED,6, // SKINCOLOR_GREEN, + SKINCOLOR_SALMON,9, // SKINCOLOR_FOREST, + SKINCOLOR_RUBY,4, // SKINCOLOR_EMERALD, + SKINCOLOR_VIOLET,5, // SKINCOLOR_MINT, + SKINCOLOR_PLUM,6, // SKINCOLOR_SEAFOAM, + SKINCOLOR_ROSY,7, // SKINCOLOR_AQUA, + SKINCOLOR_PEACHY,7, // SKINCOLOR_TEAL, + SKINCOLOR_QUAIL,5, // SKINCOLOR_WAVE, + SKINCOLOR_APRICOT,6, // SKINCOLOR_CYAN, + SKINCOLOR_SANDY,1, // SKINCOLOR_SKY, + SKINCOLOR_NEON,4, // SKINCOLOR_CERULEAN, + SKINCOLOR_CRIMSON,0, // SKINCOLOR_ICY, + SKINCOLOR_SUNSET,5, // SKINCOLOR_SAPPHIRE, + SKINCOLOR_YELLOW,4, // SKINCOLOR_CORNFLOWER, + SKINCOLOR_ORANGE,5, // SKINCOLOR_BLUE, + SKINCOLOR_PERIDOT,5, // SKINCOLOR_COBALT, + SKINCOLOR_LILAC,4, // SKINCOLOR_VAPOR, + SKINCOLOR_OLIVE,0, // SKINCOLOR_DUSK, + SKINCOLOR_BUBBLEGUM,9, // SKINCOLOR_PASTEL, + SKINCOLOR_FLAME,7, // SKINCOLOR_PURPLE, + SKINCOLOR_PASTEL,8, // SKINCOLOR_BUBBLEGUM, + SKINCOLOR_LIME,6, // SKINCOLOR_MAGENTA, + SKINCOLOR_CERULEAN,2, // SKINCOLOR_NEON, + SKINCOLOR_MINT,6, // SKINCOLOR_VIOLET, + SKINCOLOR_VAPOR,4, // SKINCOLOR_LILAC, + SKINCOLOR_MINT,7, // SKINCOLOR_PLUM, + SKINCOLOR_AQUA,1 // SKINCOLOR_ROSY, }; CV_PossibleValue_t Color_cons_t[MAXSKINCOLORS+1]; @@ -258,40 +464,7 @@ void R_InitTranslationTables(void) */ static void R_GenerateTranslationColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color) { - // Table of indices into the palette of the first entries of each translated ramp - const UINT8 skinbasecolors[] = { - 0x00, // SKINCOLOR_WHITE - 0x03, // SKINCOLOR_SILVER - 0x08, // SKINCOLOR_GREY - 0x18, // SKINCOLOR_BLACK - 0xf0, // SKINCOLOR_BEIGE - 0xd8, // SKINCOLOR_PEACH - 0xe0, // SKINCOLOR_BROWN - 0x21, // SKINCOLOR_RED - 0x28, // SKINCOLOR_CRIMSON - 0x31, // SKINCOLOR_ORANGE - 0x3a, // SKINCOLOR_RUST - 0x40, // SKINCOLOR_GOLD - 0x48, // SKINCOLOR_YELLOW - 0x54, // SKINCOLOR_TAN - 0x58, // SKINCOLOR_MOSS - 0xbc, // SKINCOLOR_PERIDOT - 0x60, // SKINCOLOR_GREEN - 0x70, // SKINCOLOR_EMERALD - 0x78, // SKINCOLOR_AQUA - 0x8c, // SKINCOLOR_TEAL - 0x80, // SKINCOLOR_CYAN - 0x92, // SKINCOLOR_BLUE - 0xaa, // SKINCOLOR_AZURE - 0xa0, // SKINCOLOR_PASTEL - 0xa0, // SKINCOLOR_PURPLE - 0xc0, // SKINCOLOR_LAVENDER - 0xb3, // SKINCOLOR_MAGENTA - 0xd0, // SKINCOLOR_PINK - 0xc8, // SKINCOLOR_ROSY - }; - INT32 i; - INT32 starttranscolor; + INT32 i, starttranscolor, skinramplength; // Handle a couple of simple special cases if (skinnum == TC_BOSS || skinnum == TC_ALLWHITE || skinnum == TC_METALSONIC || color == SKINCOLOR_NONE) @@ -311,776 +484,28 @@ static void R_GenerateTranslationColormap(UINT8 *dest_colormap, INT32 skinnum, U return; } + if (color >= MAXTRANSLATIONS) + I_Error("Invalid skin color #%hu.", (UINT16)color); + starttranscolor = (skinnum != TC_DEFAULT) ? skins[skinnum].starttranscolor : DEFAULT_STARTTRANSCOLOR; // Fill in the entries of the palette that are fixed for (i = 0; i < starttranscolor; i++) dest_colormap[i] = (UINT8)i; - for (i = (UINT8)(starttranscolor + 16); i < NUM_PALETTE_ENTRIES; i++) - dest_colormap[i] = (UINT8)i; + i = starttranscolor + 16; + if (i < NUM_PALETTE_ENTRIES) + { + for (i = (UINT8)i; i < NUM_PALETTE_ENTRIES; i++) + dest_colormap[i] = (UINT8)i; + skinramplength = 16; + } + else + skinramplength = i - NUM_PALETTE_ENTRIES; // Build the translated ramp - switch (color) - { - case SKINCOLOR_SILVER: - case SKINCOLOR_GREY: - case SKINCOLOR_BROWN: - case SKINCOLOR_GREEN: - // 16 color ramp - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i); - break; - - case SKINCOLOR_WHITE: - case SKINCOLOR_CYAN: - // 12 color ramp - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (12*i/SKIN_RAMP_LENGTH)); - break; - - case SKINCOLOR_BLACK: - case SKINCOLOR_MOSS: - case SKINCOLOR_EMERALD: - case SKINCOLOR_LAVENDER: - case SKINCOLOR_PINK: - // 8 color ramp - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1)); - break; - - case SKINCOLOR_BEIGE: - // 13 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i == 15) - dest_colormap[starttranscolor + i] = 0xed; // Darkest - else if (i <= 6) - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + ((i + 1) >> 1)); // Brightest - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i - 3); - } - break; - - case SKINCOLOR_PEACH: - // 11 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i == 0) - dest_colormap[starttranscolor + i] = 0xD0; // Lightest 1 - else if (i == 1) - dest_colormap[starttranscolor + i] = 0x30; // Lightest 2 - else if (i <= 11) - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1) - 1); - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i - 7); // Darkest - } - break; - - case SKINCOLOR_RED: - // 16 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i == 13) - dest_colormap[starttranscolor + i] = 0x47; // Semidark - else if (i > 13) - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i - 1); // Darkest - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i); - } - break; - - case SKINCOLOR_CRIMSON: - // 9 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i/2 == 6) - dest_colormap[starttranscolor + i] = 0x47; // Semidark - else if (i/2 == 7) - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i - 8); // Darkest - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1)); - } - break; - - case SKINCOLOR_ORANGE: - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i == 15) - dest_colormap[starttranscolor + i] = 0x2c; // Darkest - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i); - } - break; - - case SKINCOLOR_RUST: - // 10 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i <= 11) - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1)); - else if (i == 12) - dest_colormap[starttranscolor + i] = 0x2c; - else if (i <= 14) - dest_colormap[starttranscolor + i] = 0x2d; - else - dest_colormap[starttranscolor + i] = 0x48; - } - break; - - case SKINCOLOR_GOLD: - // 10 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i == 0) - dest_colormap[starttranscolor + i] = 0x50; // Lightest 1 - else if (i == 1) - dest_colormap[starttranscolor + i] = 0x53; // Lightest 2 - else if (i/2 == 7) - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i - 8); //Darkest - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1) - 1); - } - break; - - case SKINCOLOR_YELLOW: - // 10 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i == 0) - dest_colormap[starttranscolor + i] = 0x53; // Lightest - else if (i == 15) - dest_colormap[starttranscolor + i] = 0xed; // Darkest - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1)); - } - break; - - case SKINCOLOR_TAN: - // 8 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i/2 == 0) - dest_colormap[starttranscolor + i] = 0x51; // Lightest - else if (i/2 == 5) - dest_colormap[starttranscolor + i] = 0xf5; // Darkest 1 - else if (i/2 == 6) - dest_colormap[starttranscolor + i] = 0xf9; // Darkest 2 - else if (i/2 == 7) - dest_colormap[starttranscolor + i] = 0xed; // Darkest 3 - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1) - 1); - } - break; - - case SKINCOLOR_PERIDOT: - // 8 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i/2 == 0) - dest_colormap[starttranscolor + i] = 0x58; // Lightest - else if (i/2 == 7) - dest_colormap[starttranscolor + i] = 0x77; // Darkest - else if (i/2 >= 5) - dest_colormap[starttranscolor + i] = (UINT8)(0x5e + (i >> 1) - 5); // Semidark - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1) - 1); - } - break; - - case SKINCOLOR_AQUA: - // 10 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i == 0) - dest_colormap[starttranscolor + i] = 0x78; // Lightest - else if (i >= 14) - dest_colormap[starttranscolor + i] = (UINT8)(0x76 + i - 14); // Darkest - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1) + 1); - } - break; - - case SKINCOLOR_TEAL: - // 6 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i <= 1) - dest_colormap[starttranscolor + i] = 0x78; // Lightest - else if (i >= 13) - dest_colormap[starttranscolor + i] = 0x8a; // Darkest - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + ((i - 1)/3)); - } - break; - - case SKINCOLOR_AZURE: - // 8 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i <= 3) - dest_colormap[starttranscolor + i] = (UINT8)(0x90 + i/2); // Lightest - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1) - 2); - } - break; - - case SKINCOLOR_BLUE: - // 16 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i == 15) - dest_colormap[starttranscolor + i] = 0xfe; //Darkest 1 - else if (i == 14) - dest_colormap[starttranscolor + i] = 0xfd; //Darkest 2 - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i); - } - break; - - case SKINCOLOR_PASTEL: - // 10 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i >= 12) - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i - 7); // Darkest - else if (i <= 1) - dest_colormap[starttranscolor + i] = 0x90; // Lightest - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1) - 1); - } - break; - - case SKINCOLOR_PURPLE: - // 10 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i <= 3) - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i); // Lightest - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1) + 2); - } - break; - - case SKINCOLOR_MAGENTA: - // 9 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - if (i == 0) - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1]); // Lightest - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1) + 1); - break; - - case SKINCOLOR_ROSY: - // 9 colors - for (i = 0; i < SKIN_RAMP_LENGTH; i++) - { - if (i == 0) - dest_colormap[starttranscolor + i] = 0xfc; // Lightest - else - dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + ((i - 1) >> 1)); - } - break; - - // Super colors, from lightest to darkest! - - // Super silvers. - case SKINCOLOR_SUPERSILVER1: - for (i = 0; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)0; - for (; i < 14; i++) - dest_colormap[starttranscolor + i] = (UINT8)1; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(i-12); - break; - - case SKINCOLOR_SUPERSILVER2: - for (i = 0; i < 3; i++) - dest_colormap[starttranscolor + i] = (UINT8)(i); - dest_colormap[starttranscolor + (i++)] = (UINT8)2; - for (; i < 8; i++) - dest_colormap[starttranscolor + i] = (UINT8)3; - for (; i < 14; i++) - dest_colormap[starttranscolor + i] = (UINT8)4; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(i-9); - break; - - case SKINCOLOR_SUPERSILVER3: - dest_colormap[starttranscolor] = (UINT8)1; - for (i = 1; i < 3; i++) - dest_colormap[starttranscolor + i] = (UINT8)2; - for (; i < 6; i++) - dest_colormap[starttranscolor + i] = (UINT8)3; - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)4; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(5 + ((i-12)*2)); - break; - - case SKINCOLOR_SUPERSILVER4: - dest_colormap[starttranscolor] = (UINT8)2; - for (i = 1; i < 3; i++) - dest_colormap[starttranscolor + i] = (UINT8)3; - for (; i < 9; i++) - dest_colormap[starttranscolor + i] = (UINT8)4; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(5 + ((i-9)*2)); - break; - - case SKINCOLOR_SUPERSILVER5: - for (i = 0; i < 2; i++) - dest_colormap[starttranscolor + i] = (UINT8)3; - for (; i < 8; i++) - dest_colormap[starttranscolor + i] = (UINT8)4; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(5 + ((i-8)*2)); - break; - - // Super reds. - case SKINCOLOR_SUPERRED1: - for (i = 0; i < 10; i++) - dest_colormap[starttranscolor + i] = (UINT8)0; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(208 + ((i-10) >> 1)); - break; - - case SKINCOLOR_SUPERRED2: - for (i = 0; i < 3; i++) - dest_colormap[starttranscolor + i] = (UINT8)0; - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)(208 + ((i-3) / 3)); - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(32 + ((i-12) >> 1)); - break; - - case SKINCOLOR_SUPERRED3: - for (i = 0; i < 2; i++) - dest_colormap[starttranscolor + i] = (UINT8)0; - for (; i < 8; i++) - dest_colormap[starttranscolor + i] = (UINT8)(208 + ((i-2) >> 1)); - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(32 + ((i-8) >> 1)); - break; - - case SKINCOLOR_SUPERRED4: - dest_colormap[starttranscolor] = (UINT8)0; - for (i = 1; i < 6; i++) - dest_colormap[starttranscolor + i] = (UINT8)(208 + (i >> 1)); - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(32 + ((i-6) >> 1)); - break; - - case SKINCOLOR_SUPERRED5: - dest_colormap[starttranscolor] = (UINT8)208; - for (i = 1; i < 4; i++) - dest_colormap[starttranscolor + i] = (UINT8)(209 + (i >> 1)); - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(32 + ((i-4) >> 1)); - break; - - // Super oranges. - case SKINCOLOR_SUPERORANGE1: - for (i = 0; i < 10; i++) - dest_colormap[starttranscolor + i] = (UINT8)0; - dest_colormap[starttranscolor + (i++)] = (UINT8)208; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(48 + (i-11)); - break; - - case SKINCOLOR_SUPERORANGE2: - for (i = 0; i < 4; i++) - dest_colormap[starttranscolor + i] = (UINT8)0; - for (; i < 6; i++) - dest_colormap[starttranscolor + i] = (UINT8)208; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(48 + ((i-6) >> 1)); - break; - - case SKINCOLOR_SUPERORANGE3: - for (i = 0; i < 2; i++) - dest_colormap[starttranscolor + i] = (UINT8)0; - for (; i < 4; i++) - dest_colormap[starttranscolor + i] = (UINT8)208; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(48 + ((i-4) >> 1)); - break; - - case SKINCOLOR_SUPERORANGE4: - dest_colormap[starttranscolor] = (UINT8)0; - dest_colormap[starttranscolor + 1] = (UINT8)208; - for (i = 2; i < 13; i++) - dest_colormap[starttranscolor + i] = (UINT8)(48 + (i-2)); - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(68 + (i-13)); - break; - - case SKINCOLOR_SUPERORANGE5: - dest_colormap[starttranscolor] = (UINT8)208; - for (i = 1; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)(48 + (i-1)); - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(68 + (i-12)); - break; - - // Super golds. - case SKINCOLOR_SUPERGOLD1: - for (i = 0; i < 10; i++) - dest_colormap[starttranscolor + i] = (UINT8)0; // True white - for (; i < 12; i++) // White-yellow fade - dest_colormap[starttranscolor + i] = (UINT8)80; - for (; i < 15; i++) // White-yellow fade - dest_colormap[starttranscolor + i] = (UINT8)(81 + (i-12)); - dest_colormap[starttranscolor + 15] = (UINT8)72; - break; - - case SKINCOLOR_SUPERGOLD2: - dest_colormap[starttranscolor] = (UINT8)(0); - for (i = 1; i < 4; i++) // White-yellow fade - dest_colormap[starttranscolor + i] = (UINT8)(80 + (i-1)); - for (; i < 6; i++) // Yellow - dest_colormap[starttranscolor + i] = (UINT8)83; - for (; i < 8; i++) // Yellow - dest_colormap[starttranscolor + i] = (UINT8)72; - for (; i < 14; i++) // Yellow - dest_colormap[starttranscolor + i] = (UINT8)73; - for (; i < 16; i++) // With a fine golden finish! :3 - dest_colormap[starttranscolor + i] = (UINT8)(64 + (i-14)); - break; - - case SKINCOLOR_SUPERGOLD3: - for (i = 0; i < 2; i++) // White-yellow fade - dest_colormap[starttranscolor + i] = (UINT8)(81 + i); - for (; i < 4; i++) - dest_colormap[starttranscolor + i] = (UINT8)83; - for (; i < 6; i++) // Yellow - dest_colormap[starttranscolor + i] = (UINT8)72; - for (; i < 12; i++) // Yellow - dest_colormap[starttranscolor + i] = (UINT8)73; - for (; i < 16; i++) // With a fine golden finish! :3 - dest_colormap[starttranscolor + i] = (UINT8)(64 + (i-12)); - break; - - case SKINCOLOR_SUPERGOLD4: // "The SSNTails" - dest_colormap[starttranscolor] = (UINT8)83; // Golden shine - for (i = 1; i < 3; i++) // Yellow - dest_colormap[starttranscolor + i] = (UINT8)(72); - for (; i < 9; i++) // Yellow - dest_colormap[starttranscolor + i] = (UINT8)(73); - for (; i < 16; i++) // With a fine golden finish! :3 - dest_colormap[starttranscolor + i] = (UINT8)(64 + (i-9)); - break; - - case SKINCOLOR_SUPERGOLD5: // Golden Delicious - for (i = 0; i < 2; i++) // Yellow - dest_colormap[starttranscolor + i] = (UINT8)(72); - for (; i < 8; i++) // Yellow - dest_colormap[starttranscolor + i] = (UINT8)(73); - for (; i < 16; i++) // With a fine golden finish! :3 - dest_colormap[starttranscolor + i] = (UINT8)(64 + (i-8)); - break; - - // Super peridots. (nyeheheheh) - case SKINCOLOR_SUPERPERIDOT1: - for (i = 0; i < 10; i++) - dest_colormap[starttranscolor + i] = (UINT8)0; - for (; i < 13; i++) - dest_colormap[starttranscolor + i] = (UINT8)88; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)188; - break; - - case SKINCOLOR_SUPERPERIDOT2: - dest_colormap[starttranscolor] = (UINT8)(0); - for (i = 1; i < 4; i++) - dest_colormap[starttranscolor + i] = (UINT8)88; - for (; i < 8; i++) - dest_colormap[starttranscolor + i] = (UINT8)188; - for (; i < 14; i++) - dest_colormap[starttranscolor + i] = (UINT8)189; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)190; - break; - - case SKINCOLOR_SUPERPERIDOT3: - for (i = 0; i < 2; i++) - dest_colormap[starttranscolor + i] = (UINT8)88; - for (; i < 6; i++) - dest_colormap[starttranscolor + i] = (UINT8)188; - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)189; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(190 + ((i-12) >> 1)); - break; - - case SKINCOLOR_SUPERPERIDOT4: - dest_colormap[starttranscolor] = (UINT8)88; - for (i = 1; i < 3; i++) - dest_colormap[starttranscolor + i] = (UINT8)188; - for (; i < 9; i++) - dest_colormap[starttranscolor + i] = (UINT8)189; - for (; i < 13; i++) - dest_colormap[starttranscolor + i] = (UINT8)(190 + ((i-9) >> 1)); - for (; i < 15; i++) - dest_colormap[starttranscolor + i] = (UINT8)94; - dest_colormap[starttranscolor + i] = (UINT8)95; - break; - - case SKINCOLOR_SUPERPERIDOT5: - for (i = 0; i < 2; i++) - dest_colormap[starttranscolor + i] = (UINT8)188; - for (; i < 8; i++) - dest_colormap[starttranscolor + i] = (UINT8)189; - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)(190 + ((i-8) >> 1)); - for (; i < 14; i++) - dest_colormap[starttranscolor + i] = (UINT8)94; - dest_colormap[starttranscolor + (i++)] = (UINT8)95; - dest_colormap[starttranscolor + i] = (UINT8)119; - break; - - // Super cyans. - case SKINCOLOR_SUPERCYAN1: - for (i = 0; i < 10; i++) - dest_colormap[starttranscolor + i] = (UINT8)0; - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)128; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(129 + (i-12)); - break; - - case SKINCOLOR_SUPERCYAN2: - dest_colormap[starttranscolor] = (UINT8)0; - for (i = 1; i < 4; i++) - dest_colormap[starttranscolor + i] = (UINT8)(128 + (i-1)); - for (; i < 8; i++) - dest_colormap[starttranscolor + i] = (UINT8)(131 + ((i-4) >> 1)); - for (; i < 14; i++) - dest_colormap[starttranscolor + i] = (UINT8)133; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)134; - break; - - case SKINCOLOR_SUPERCYAN3: - for (i = 0; i < 2; i++) - dest_colormap[starttranscolor + i] = (UINT8)(129 + i); - for (; i < 6; i++) - dest_colormap[starttranscolor + i] = (UINT8)(131 + ((i-2) >> 1)); - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)133; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(134 + ((i-12) >> 1)); - break; - - case SKINCOLOR_SUPERCYAN4: - dest_colormap[starttranscolor] = (UINT8)131; - for (i = 1; i < 3; i++) - dest_colormap[starttranscolor + i] = (UINT8)132; - for (; i < 9; i++) - dest_colormap[starttranscolor + i] = (UINT8)133; - for (; i < 13; i++) - dest_colormap[starttranscolor + i] = (UINT8)(134 + ((i-9) >> 1)); - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(136 + (i-13)); - break; - - case SKINCOLOR_SUPERCYAN5: - for (i = 0; i < 2; i++) - dest_colormap[starttranscolor + i] = (UINT8)132; - for (; i < 8; i++) - dest_colormap[starttranscolor + i] = (UINT8)133; - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)(134 + ((i-8) >> 1)); - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(136 + (i-12)); - break; - - // Super purples. - case SKINCOLOR_SUPERPURPLE1: - for (i = 0; i < 10; i++) - dest_colormap[starttranscolor + i] = (UINT8)0; - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)144; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(160 + (i-12)); - break; - - case SKINCOLOR_SUPERPURPLE2: - dest_colormap[starttranscolor] = (UINT8)0; - dest_colormap[starttranscolor + 1] = (UINT8)144; - for (i = 2; i < 4; i++) - dest_colormap[starttranscolor + i] = (UINT8)(160 + (i-2)); - for (; i < 8; i++) - dest_colormap[starttranscolor + i] = (UINT8)(162 + ((i-4) >> 1)); - for (; i < 14; i++) - dest_colormap[starttranscolor + i] = (UINT8)164; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)165; - break; - - case SKINCOLOR_SUPERPURPLE3: - for (i = 0; i < 2; i++) - dest_colormap[starttranscolor + i] = (UINT8)(160 + i); - for (; i < 6; i++) - dest_colormap[starttranscolor + i] = (UINT8)(162 + ((i-2) >> 1)); - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)164; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(165 + ((i-12) >> 1)); - break; - - case SKINCOLOR_SUPERPURPLE4: - dest_colormap[starttranscolor] = (UINT8)162; - for (i = 1; i < 3; i++) - dest_colormap[starttranscolor + i] = (UINT8)163; - for (; i < 9; i++) - dest_colormap[starttranscolor + i] = (UINT8)164; - for (; i < 13; i++) - dest_colormap[starttranscolor + i] = (UINT8)(165 + ((i-9) >> 1)); - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(167 + (i-13)); - break; - - case SKINCOLOR_SUPERPURPLE5: - for (i = 0; i < 2; i++) - dest_colormap[starttranscolor + i] = (UINT8)163; - for (; i < 8; i++) - dest_colormap[starttranscolor + i] = (UINT8)164; - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)(165 + ((i-8) >> 1)); - for (; i < 15; i++) - dest_colormap[starttranscolor + i] = (UINT8)(167 + (i-12)); - dest_colormap[starttranscolor + i] = (UINT8)253; - break; - - // Super rusts. - case SKINCOLOR_SUPERRUST1: - for (i = 0; i < 2; i++) - dest_colormap[starttranscolor + i] = (UINT8)0; - for (; i < 5; i++) - dest_colormap[starttranscolor + i] = (UINT8)208; - for (; i < 7; i++) - dest_colormap[starttranscolor + i] = (UINT8)48; - for (; i < 10; i++) - dest_colormap[starttranscolor + i] = (UINT8)(49 + (i-7)); - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)(55 + ((i-10)*3)); - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(68 + (i-11)); - break; - - case SKINCOLOR_SUPERRUST2: - for (i = 0; i < 4; i++) - dest_colormap[starttranscolor + i] = (UINT8)48; - for (; i < 9; i++) - dest_colormap[starttranscolor + i] = (UINT8)(49 + (i-4)); - for (; i < 11; i++) - dest_colormap[starttranscolor + i] = (UINT8)(56 + ((i-9)*2)); - for (; i < 15; i++) - dest_colormap[starttranscolor + i] = (UINT8)(68 + (i-11)); - dest_colormap[starttranscolor + i] = (UINT8)71; - break; - - case SKINCOLOR_SUPERRUST3: - dest_colormap[starttranscolor] = (UINT8)49; - for (i = 1; i < 3; i++) - dest_colormap[starttranscolor + i] = (UINT8)50; - for (; i < 5; i++) - dest_colormap[starttranscolor + i] = (UINT8)(51 + (i-3)); - for (; i < 8; i++) - dest_colormap[starttranscolor + i] = (UINT8)(54 + (i-5)); - dest_colormap[starttranscolor + (i++)] = (UINT8)58; - for (; i < 15; i++) - dest_colormap[starttranscolor + i] = (UINT8)(68 + ((i-7) >> 1)); - dest_colormap[starttranscolor + i] = (UINT8)46; - break; - - case SKINCOLOR_SUPERRUST4: - dest_colormap[starttranscolor] = (UINT8)83; - dest_colormap[starttranscolor + 1] = (UINT8)72; - for (i = 2; i < 6; i++) - dest_colormap[starttranscolor + i] = (UINT8)(64 + (i-2)); - for (; i < 14; i++) - dest_colormap[starttranscolor + i] = (UINT8)(68 + ((i-6) >> 1)); - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)46; - break; - - case SKINCOLOR_SUPERRUST5: - for (i = 0; i < 3; i++) - dest_colormap[starttranscolor + i] = (UINT8)(64 + i); - for (; i < 7; i++) - dest_colormap[starttranscolor + i] = (UINT8)(67 + ((i-3) >> 1)); - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)(233 + (i-7)); - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(238 + ((i-12) >> 1)); - break; - - // Super tans. - case SKINCOLOR_SUPERTAN1: - for (i = 0; i < 10; i++) - dest_colormap[starttranscolor + i] = (UINT8)0; - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(80 + ((i-10) >> 1)); - break; - - case SKINCOLOR_SUPERTAN2: - dest_colormap[starttranscolor] = (UINT8)0; - for (i = 1; i < 7; i++) - dest_colormap[starttranscolor + i] = (UINT8)(80 + ((i-1) >> 1)); - dest_colormap[starttranscolor + (i++)] = (UINT8)82; - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)84; - for (; i < 15; i++) - dest_colormap[starttranscolor + i] = (UINT8)(85 + (i-12)); - dest_colormap[starttranscolor + i] = (UINT8)245; - break; - - case SKINCOLOR_SUPERTAN3: - dest_colormap[starttranscolor] = (UINT8)80; - for (i = 1; i < 5; i++) - dest_colormap[starttranscolor + i] = (UINT8)(81 + ((i-1) >> 1)); - dest_colormap[starttranscolor + (i++)] = (UINT8)82; - for (; i < 10; i++) - dest_colormap[starttranscolor + i] = (UINT8)84; - for (; i < 13; i++) - dest_colormap[starttranscolor + i] = (UINT8)(85 + (i-10)); - for (; i < 16; i++) - dest_colormap[starttranscolor + i] = (UINT8)(245 + ((i-13)*2)); - break; - - case SKINCOLOR_SUPERTAN4: - dest_colormap[starttranscolor] = (UINT8)81; - for (i = 1; i < 5; i++) - dest_colormap[starttranscolor + i] = (UINT8)82; - for (; i < 8; i++) - dest_colormap[starttranscolor + i] = (UINT8)84; - for (; i < 11; i++) - dest_colormap[starttranscolor + i] = (UINT8)(85 + (i-8)); - for (; i < 15; i++) - dest_colormap[starttranscolor + i] = (UINT8)(245 + ((i-11)*2)); - dest_colormap[starttranscolor + i] = (UINT8)237; - break; - - case SKINCOLOR_SUPERTAN5: - for (i = 0; i < 2; i++) - dest_colormap[starttranscolor + i] = (UINT8)82; - for (; i < 5; i++) - dest_colormap[starttranscolor + i] = (UINT8)84; - for (; i < 8; i++) - dest_colormap[starttranscolor + i] = (UINT8)(85 + (i-5)); - for (; i < 12; i++) - dest_colormap[starttranscolor + i] = (UINT8)(245 + (i-8)); - for (; i < 15; i++) - dest_colormap[starttranscolor + i] = (UINT8)(237 + (i-12)); - dest_colormap[starttranscolor + i] = (UINT8)239; - break; - - default: - I_Error("Invalid skin color #%hu.", (UINT16)color); - break; - } + for (i = 0; i < skinramplength; i++) + dest_colormap[starttranscolor + i] = (UINT8)Color_Index[color-1][i]; }