From e5e472edf1b58c309aa4da77fca1b309c0f66882 Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Wed, 25 Oct 2017 02:00:17 +0100 Subject: [PATCH 1/8] Crash fix --- src/p_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index 70e1ce10..e059c858 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3128,7 +3128,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da K_SpinPlayer(player, source); damage = player->mo->health - 1; P_RingDamage(player, inflictor, source, damage); - if (inflictor->type == MT_GREENITEM || inflictor->type == MT_REDITEM || inflictor->type == MT_REDITEMDUD) + if (inflictor && (inflictor->type == MT_GREENITEM || inflictor->type == MT_REDITEM || inflictor->type == MT_REDITEMDUD)) P_PlayerRingBurst(player, 5); player->mo->momx = player->mo->momy = 0; if (P_IsLocalPlayer(player)) From 28297d9f58061df353e95fe5c467ef9ef903f1a7 Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Wed, 25 Oct 2017 02:47:24 +0100 Subject: [PATCH 2/8] Add separate boost sound for start boost Allows us to set it to be singular, stopping really loud start boosts with many players --- src/k_kart.c | 22 +++++++++++++--------- src/k_kart.h | 2 +- src/p_spec.c | 2 +- src/sounds.c | 1 + src/sounds.h | 1 + 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 4f294b8a..9a00b3ce 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1303,7 +1303,7 @@ void K_LakituChecker(player_t *player) player->kartstuff[k_lakitu]--; // Quick! You only have three tics to boost! if (cmd->buttons & BT_ACCELERATE) - K_DoMushroom(player, true); + K_DoMushroom(player, true, false); } } } @@ -2228,10 +2228,14 @@ static void K_DoBooSteal(player_t *player) } } -void K_DoMushroom(player_t *player, boolean doPFlag) +void K_DoMushroom(player_t *player, boolean doPFlag, boolean startboost) { + sfxenum_t boostsound = sfx_mush; + if (startboost) + boostsound = sfx_sboost; + if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) - S_StartSound(player->mo, sfx_mush); + S_StartSound(player->mo, boostsound); player->kartstuff[k_mushroomtimer] = mushroomtime; @@ -2624,14 +2628,14 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (ATTACK_IS_DOWN && !HOLDING_ITEM && onground && player->kartstuff[k_goldshroom] == 1 && player->kartstuff[k_goldshroomtimer] == 0 && NO_BOO) { - K_DoMushroom(player, true); + K_DoMushroom(player, true, false); player->kartstuff[k_goldshroomtimer] = itemtime; player->kartstuff[k_goldshroom] = 0; } // GoldenMushroom power else if (ATTACK_IS_DOWN && player->kartstuff[k_goldshroomtimer] > 1 && onground && NO_BOO) { - K_DoMushroom(player, true); + K_DoMushroom(player, true, false); //player->kartstuff[k_goldshroomtimer] -= 10; //if (player->kartstuff[k_goldshroomtimer] < 1) // player->kartstuff[k_goldshroomtimer] = 1; @@ -2639,19 +2643,19 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // TripleMushroom power else if (ATTACK_IS_DOWN && !HOLDING_ITEM && player->kartstuff[k_mushroom] == 4 && onground && NO_BOO) { - K_DoMushroom(player, true); + K_DoMushroom(player, true, false); player->kartstuff[k_mushroom] = 2; } // DoubleMushroom power else if (ATTACK_IS_DOWN && !HOLDING_ITEM && player->kartstuff[k_mushroom] == 2 && onground && NO_BOO) { - K_DoMushroom(player, true); + K_DoMushroom(player, true, false); player->kartstuff[k_mushroom] = 1; } // Mushroom power else if (ATTACK_IS_DOWN && !HOLDING_ITEM && player->kartstuff[k_mushroom] == 1 && onground && NO_BOO) { - K_DoMushroom(player, true); + K_DoMushroom(player, true, false); player->kartstuff[k_mushroom] = 0; } // Star power @@ -3105,7 +3109,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // Get an instant boost! if (player->kartstuff[k_boostcharge] >= 7 && player->kartstuff[k_boostcharge] <= 10) { - K_DoMushroom(player, false); + K_DoMushroom(player, false, true); } // You overcharged your engine? Those things are expensive!!! if (player->kartstuff[k_boostcharge] > 10) diff --git a/src/k_kart.h b/src/k_kart.h index dfe7ec39..1cc5e9a1 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -22,7 +22,7 @@ void K_SquishPlayer(player_t *player, mobj_t *source); void K_ExplodePlayer(player_t *player, mobj_t *source); void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit); void K_SpawnDriftTrail(player_t *player); -void K_DoMushroom(player_t *player, boolean doPFlag); +void K_DoMushroom(player_t *player, boolean doPFlag, boolean startboost); INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue); void K_MomentumToFacing(player_t *player); fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower); diff --git a/src/p_spec.c b/src/p_spec.c index 27a408c7..275d6f08 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3934,7 +3934,7 @@ DoneSection2: player->kartstuff[k_floorboost] = 3; else player->kartstuff[k_floorboost] = 2; - K_DoMushroom(player, false); + K_DoMushroom(player, false, false); break; case 7: // SRB2kart 190117 - Oil Slick diff --git a/src/sounds.c b/src/sounds.c index 07777514..bf2453e2 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -474,6 +474,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"kart2", false, 48, 16, -1, NULL, 0, -1, -1, LUMPERROR}, {"kart3", false, 48, 16, -1, NULL, 0, -1, -1, LUMPERROR}, {"mlap", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"sboost", true, 90, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"mush", false, 90, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"star", false, 140, 16, -1, NULL, 0, -1, -1, LUMPERROR}, {"mega", false, 140, 16, -1, NULL, 0, -1, -1, LUMPERROR}, diff --git a/src/sounds.h b/src/sounds.h index 66a9b729..57571771 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -545,6 +545,7 @@ typedef enum sfx_kart2, sfx_kart3, sfx_mlap, + sfx_sboost, sfx_mush, sfx_star, sfx_mega, From f7b637663c6ed03729f607f880241dd046d1f4bb Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Wed, 25 Oct 2017 20:30:02 +0100 Subject: [PATCH 3/8] Setup intro finally --- src/f_finale.c | 532 ++----------------------------------------------- src/sounds.c | 3 +- src/sounds.h | 1 + 3 files changed, 18 insertions(+), 518 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index a79500d8..e6bfa7e8 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -43,7 +43,6 @@ static INT32 continuetime; // Short delay when continuing static tic_t animtimer; // Used for some animation timings static INT32 roidtics; // Asteroid spinning -static INT32 deplete; static tic_t stoptimer; static boolean keypressed = false; @@ -247,7 +246,7 @@ static void F_SkyScroll(INT32 scrollspeed) // ============= // INTRO SCENE // ============= -#define NUMINTROSCENES 16 +#define NUMINTROSCENES 1 INT32 intro_scenenum = 0; INT32 intro_curtime = 0; @@ -255,22 +254,7 @@ const char *introtext[NUMINTROSCENES]; static tic_t introscenetime[NUMINTROSCENES] = { - 7*TICRATE + (TICRATE/2), // STJr Presents - 11*TICRATE + (TICRATE/2), // Two months had passed since... - 15*TICRATE + (TICRATE/2), // As it was about to drain the rings... - 14*TICRATE, // What Sonic, Tails, and Knuckles... - 18*TICRATE, // About once every year, a strange... - 19*TICRATE + (TICRATE/2), // Curses! Eggman yelled. That ridiculous... - 19*TICRATE + (TICRATE/4), // It was only later that he had an idea... - 10*TICRATE + (TICRATE/2), // Before beginning his scheme, Eggman decided to give Sonic... - 16*TICRATE, // We're ready to fire in 15 seconds, the robot said... - 16*TICRATE, // Meanwhile, Sonic was tearing across the zones... - 16*TICRATE + (TICRATE/2), // Sonic knew he was getting closer to the city... - 17*TICRATE, // Greenflower City was gone... - 16*TICRATE + (TICRATE/2), // You're not quite as dead as we thought, huh?... - 18*TICRATE + (TICRATE/2), // Eggman took this as his cue and blasted off... - 16*TICRATE, // Easy! We go find Eggman and stop his... - 25*TICRATE, // I'm just finding what mission obje... + 8*TICRATE, // KART KR(eW }; // custom intros @@ -289,149 +273,6 @@ void F_StartIntro(void) introtext[0] = " #"; - introtext[1] = M_GetText( - "Two months had passed since Dr. Eggman\n" - "tried to take over the world using his\n" - "Ring Satellite.\n#"); - - introtext[2] = M_GetText( - "As it was about to drain the rings\n" - "away from the planet, Sonic burst into\n" - "the Satellite and for what he thought\n" - "would be the last time,\xB4 defeated\n" - "Dr. Eggman.\n#"); - - introtext[3] = M_GetText( - "\nWhat Sonic, Tails, and Knuckles had\n" - "not anticipated was that Eggman would\n" - "return,\xB8 bringing an all new threat.\n#"); - - introtext[4] = M_GetText( - "\xA8""About once every year, a strange asteroid\n" - "hovers around the planet.\xBF It suddenly\n" - "appears from nowhere, circles around, and\n" - "\xB6- just as mysteriously as it arrives -\xB6\n" - "vanishes after about two months.\xBF\n" - "No one knows why it appears, or how.\n#"); - - introtext[5] = M_GetText( - "\xA7\"Curses!\"\xA9\xBA Eggman yelled. \xA7\"That hedgehog\n" - "and his ridiculous friends will pay\n" - "dearly for this!\"\xA9\xC8 Just then his scanner\n" - "blipped as the Black Rock made its\n" - "appearance from nowhere.\xBF Eggman looked at\n" - "the screen, and just shrugged it off.\n#"); - - introtext[6] = M_GetText( - "It was only later\n" - "that he had an\n" - "idea. \xBF\xA7\"The Black\n" - "Rock usually has a\n" - "lot of energy\n" - "within it\xAC...\xA7\xBF\n" - "If I can somehow\n" - "harness this,\xB8 I\n" - "can turn it into\n" - "the ultimate\n" - "battle station\xAC...\xA7\xBF\n" - "And every last\n" - "person will be\n" - "begging for mercy,\xB8\xA8\n" - "including Sonic!\"\n#"); - - introtext[7] = M_GetText( - "\xA8\nBefore beginning his scheme,\n" - "Eggman decided to give Sonic\n" - "a reunion party...\n#"); - - introtext[8] = M_GetText( - "\xA5\"We're\xB6 ready\xB6 to\xB4 fire\xB6 in\xB6 15\xB6 seconds!\"\xA8\xB8\n" - "The robot said, his voice crackling a\n" - "little down the com-link. \xBF\xA7\"Good!\"\xA8\xB8\n" - "Eggman sat back in his Egg-Mobile and\n" - "began to count down as he saw the\n" - "GreenFlower city on the main monitor.\n#"); - - introtext[9] = M_GetText( - "\xA5\"10...\xD2""9...\xD2""8...\"\xA8\xD2\n" - "Meanwhile, Sonic was tearing across the\n" - "zones. Everything became a blur as he\n" - "ran around loops, skimmed over water,\n" - "and catapulted himself off rocks with\n" - "his phenomenal speed.\n#"); - - introtext[10] = M_GetText( - "\xA5\"6...\xD2""5...\xD2""4...\"\xA8\xD2\n" - "Sonic knew he was getting closer to the\n" - "City, and pushed himself harder.\xB4 Finally,\n" - "the city appeared in the horizon.\xD2\xD2\n" - "\xA5\"3...\xD2""2...\xD2""1...\xD2""Zero.\"\n#"); - - introtext[11] = M_GetText( - "GreenFlower City was gone.\xC4\n" - "Sonic arrived just in time to see what\n" - "little of the 'ruins' were left.\n" - "Everyone and everything in the city\n" - "had been obliterated.\n#"); - - introtext[12] = M_GetText( - "\xA7\"You're not quite as dead as we thought,\n" - "huh?\xBF Are you going to tell us your plan as\n" - "usual or will I \xA8\xB4'have to work it out'\xA7 or\n" - "something?\"\xD2\xD2\n" - "\"We'll see\xAA...\xA7\xBF let's give you a quick warm\n" - "up, Sonic!\xA6\xC4 JETTYSYNS!\xA7\xBD Open fire!\"\n#"); - - introtext[13] = M_GetText( - "Eggman took this\n" - "as his cue and\n" - "blasted off,\n" - "leaving Sonic\n" - "and Tails behind.\xB6\n" - "Tails looked at\n" - "the ruins of the\n" - "Greenflower City\n" - "with a grim face\n" - "and sighed.\xC6\n" - "\xA7\"Now\xB6 what do we\n" - "do?\",\xA9 he asked.\n#"); - - introtext[14] = M_GetText( - "\xA7\"Easy!\xBF We go\n" - "find Eggman\n" - "and stop his\n" - "latest\n" - "insane plan.\xBF\n" - "Just like\n" - "we've always\n" - "done,\xBA right?\xD2\n\n" - "\xAE...\xA9\xD2\n\n" - "\"Tails, what\n" - "\xAA*ARE*\xA9 you\n" - "doing?\"\n#"); - - introtext[15] = M_GetText( - "\xA8\"I'm just finding what mission obje\xAC\xB1...\xBF\n" - "\xA6""a-\xB8""ha!\xBF Here it is!\xA8\xBF This will only give us\n" - "the robot's primary objective.\xBF It says\xAC\xB1...\"\n" - "\xD2\xA3\x83" - "* LOCATE AND RETRIEVE: CHAOS EMERALDS *" - "\xBF\n" - "* CLOSEST LOCATION: GREENFLOWER ZONE *" - "\x80\n\xA9\xD2\xD2" - "\"All right, then\xAF... \xD2\xD2\xA7let's go!\"\n#"); - -/* - "What are we waiting for? The first emerald is ours!" Sonic was about to - run, when he saw a shadow pass over him, he recognized the silhouette - instantly. - "Knuckles!" Sonic said. The echidna stopped his glide and landed - facing Sonic. "What are you doing here?" - He replied, "This crisis affects the Floating Island, - if that explosion I saw is anything to go by." - If you're willing to help then... let's go!" -*/ - G_SetGamestate(GS_INTRO); gameaction = ga_nothing; playerdeadview = false; @@ -444,6 +285,7 @@ void F_StartIntro(void) finalecount = animtimer = stoptimer = 0; roidtics = BASEVIDWIDTH - 64; timetonext = introscenetime[intro_scenenum]; + S_StopMusic(); } // @@ -455,90 +297,24 @@ static void F_IntroDrawScene(void) INT32 cx = 8, cy = 128; patch_t *background = NULL; INT32 bgxoffs = 0; - void *patch; // DRAW A FULL PIC INSTEAD OF FLAT! - if (intro_scenenum == 0); - else if (intro_scenenum == 1) - background = W_CachePatchName("INTRO1", PU_CACHE); - else if (intro_scenenum == 2) + if (intro_scenenum == 0) { - background = W_CachePatchName("INTRO2", PU_CACHE); - highres = true; - } - else if (intro_scenenum == 3) - background = W_CachePatchName("INTRO3", PU_CACHE); - else if (intro_scenenum == 4) - background = W_CachePatchName("INTRO4", PU_CACHE); - else if (intro_scenenum == 5) - { - if (intro_curtime >= 5*TICRATE) - background = W_CachePatchName("RADAR", PU_CACHE); - else + if (finalecount == 8) + S_StartSound(NULL, sfx_vroom); + else if (finalecount == 47) { - background = W_CachePatchName("DRAT", PU_CACHE); - highres = true; + // Need to use M_Random otherwise it always uses the same sound + INT32 rskin = M_RandomKey(numskins); + UINT8 rtaunt = M_RandomKey(4); + sfxenum_t rsound = skins[rskin].soundsid[SKSPLTNT1+rtaunt]; + S_StartSound(NULL, rsound); } - } - else if (intro_scenenum == 6) - { - background = W_CachePatchName("INTRO6", PU_CACHE); - cx = 180; - cy = 8; - } - else if (intro_scenenum == 7) - { - if (intro_curtime >= 6*TICRATE) - background = W_CachePatchName("SGRASS5", PU_CACHE); - else - background = W_CachePatchName("SGRASS1", PU_CACHE); - } - else if (intro_scenenum == 8) - { - background = W_CachePatchName("WATCHING", PU_CACHE); - highres = true; - } - else if (intro_scenenum == 9) - { - background = W_CachePatchName("ZOOMING", PU_CACHE); - highres = true; - } - else if (intro_scenenum == 10); - else if (intro_scenenum == 11) - background = W_CachePatchName("INTRO5", PU_CACHE); - else if (intro_scenenum == 12) - { - if (intro_curtime >= 7*TICRATE) - background = W_CachePatchName("CONFRONT", PU_CACHE); - else - background = W_CachePatchName("REVENGE", PU_CACHE); - highres = true; - } - else if (intro_scenenum == 13) - { - background = W_CachePatchName("TAILSSAD", PU_CACHE); - highres = true; - bgxoffs = 144; - cx = 8; - cy = 8; - } - else if (intro_scenenum == 14) - { - if (intro_curtime >= 7*TICRATE) - background = W_CachePatchName("SONICDO2", PU_CACHE); - else - background = W_CachePatchName("SONICDO1", PU_CACHE); - highres = true; - cx = 224; - cy = 8; - } - else if (intro_scenenum == 15) - { - background = W_CachePatchName("INTRO7", PU_CACHE); - highres = true; + background = W_CachePatchName("KARTKREW", PU_CACHE); } - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120); if (background) { @@ -547,210 +323,12 @@ static void F_IntroDrawScene(void) else V_DrawScaledPatch(bgxoffs, 0, 0, background); } - else if (intro_scenenum == 0) // STJr presents - { - // "Waaaaaaah" intro - if (finalecount-TICRATE/2 < 4*TICRATE+23) { - // aspect is FRACUNIT/2 for 4:3 (source) resolutions, smaller for 16:10 (SRB2) resolutions - fixed_t aspect = (FRACUNIT + (FRACUNIT*4/3 - FRACUNIT*vid.width/vid.height)/2)>>1; - fixed_t x,y; - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 2); - if (finalecount < 30) { // Cry! - if (finalecount < 4) - S_StopMusic(); - if (finalecount == 4) - S_ChangeMusicInternal("stjr", false); - x = (BASEVIDWIDTH< 6) { - V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH2", PU_CACHE)), aspect); - W_UnlockCachedPatch(patch); - } - if (finalecount > 10) { - V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH3", PU_CACHE)), aspect); - W_UnlockCachedPatch(patch); - } - if (finalecount > 14) { - V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH4", PU_CACHE)), aspect); - W_UnlockCachedPatch(patch); - } - } - else if (finalecount-30 < 20) { // Big eggy - background = W_CachePatchName("FEEDIN", PU_CACHE); - x = (BASEVIDWIDTH< 4*TICRATE) { // Door is being raised! - int ftime = (finalecount-TICRATE/2-4*TICRATE); - y -= FixedDiv((ftime*ftime)< 5*TICRATE && timetonext < 6*TICRATE) - { - if (!(finalecount & 3)) - background = W_CachePatchName("BRITEGG1", PU_CACHE); - else - background = W_CachePatchName("DARKEGG1", PU_CACHE); - - V_DrawScaledPatch(0, 0, 0, background); - } - else if (timetonext > 3*TICRATE && timetonext < 4*TICRATE) - { - if (!(finalecount & 3)) - background = W_CachePatchName("BRITEGG2", PU_CACHE); - else - background = W_CachePatchName("DARKEGG2", PU_CACHE); - - V_DrawScaledPatch(0, 0, 0, background); - } - else if (timetonext > 1*TICRATE && timetonext < 2*TICRATE) - { - if (!(finalecount & 3)) - background = W_CachePatchName("BRITEGG3", PU_CACHE); - else - background = W_CachePatchName("DARKEGG3", PU_CACHE); - - V_DrawScaledPatch(0, 0, 0, background); - } - else - { - F_SkyScroll(80*4); - if (timetonext == 6) - { - stoptimer = finalecount; - animtimer = finalecount % 16; - } - else if (timetonext >= 0 && timetonext < 6) - { - animtimer = stoptimer; - deplete -= 32; - } - else - { - animtimer = finalecount % 16; - deplete = 160; - } - - if (finalecount & 1) - { - V_DrawScaledPatch(deplete, 8, 0, (patch = W_CachePatchName("RUN2", PU_CACHE))); - W_UnlockCachedPatch(patch); - V_DrawScaledPatch(deplete, 72, 0, (patch = W_CachePatchName("PEELOUT2", PU_CACHE))); - W_UnlockCachedPatch(patch); - } - else - { - V_DrawScaledPatch(deplete, 8, 0, (patch = W_CachePatchName("RUN1", PU_CACHE))); - W_UnlockCachedPatch(patch); - V_DrawScaledPatch(deplete, 72, 0, (patch = W_CachePatchName("PEELOUT1", PU_CACHE))); - W_UnlockCachedPatch(patch); - } - - { // Fixing up the black box rendering to look right in resolutions <16:10 -Red - INT32 y = 112; - INT32 h = BASEVIDHEIGHT - 112; - if (vid.height != BASEVIDHEIGHT * vid.dupy) - { - INT32 adjust = (vid.height/vid.dupy)-200; - adjust /= 2; - y += adjust; - h += adjust; - V_DrawFill(0, 0, BASEVIDWIDTH, adjust, 31); // Render a black bar on top so it keeps the "cinematic" windowboxing... I just prefer it this way. -Red - } - V_DrawFill(0, y, BASEVIDWIDTH, h, 31); - } - } - } W_UnlockCachedPatch(background); - if (intro_scenenum == 4) // The asteroid SPINS! - { - if (roidtics >= 0) - { - V_DrawScaledPatch(roidtics, 24, 0, - (patch = W_CachePatchName(va("ROID00%.2d", intro_curtime%35), PU_CACHE))); - W_UnlockCachedPatch(patch); - } - } - if (animtimer) animtimer--; - if (intro_scenenum == 7 && intro_curtime > 7*TICRATE) - { - patch_t *sgrass; - - if (intro_curtime >= 7*TICRATE + ((TICRATE/7)*2)) - sgrass = W_CachePatchName("SGRASS4", PU_CACHE); - else if (intro_curtime >= 7*TICRATE + (TICRATE/7)) - sgrass = W_CachePatchName("SGRASS3", PU_CACHE); - else - sgrass = W_CachePatchName("SGRASS2", PU_CACHE); - V_DrawScaledPatch(123, 4, 0, sgrass); - - W_UnlockCachedPatch(sgrass); - } - V_DrawString(cx, cy, 0, cutscene_disptext); } @@ -771,31 +349,6 @@ void F_IntroDrawer(void) F_RunWipe(99,true); } - S_ChangeMusicInternal("read_m", false); - } - else if (intro_scenenum == 3) - roidtics = BASEVIDWIDTH - 64; - else if (intro_scenenum == 10) - { - // The only fade to white in the entire damn game. - if (rendermode != render_none) - { - F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0); - F_WipeEndScreen(); - F_RunWipe(99,true); - } - } - else if (intro_scenenum == 15) - { - if (rendermode != render_none) - { - F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); - F_WipeEndScreen(); - F_RunWipe(99,true); - } - // Stay on black for a bit. =) { tic_t quittime; @@ -812,6 +365,7 @@ void F_IntroDrawer(void) D_StartTitle(); return; } + F_NewCutscene(introtext[++intro_scenenum]); timetonext = introscenetime[intro_scenenum]; @@ -822,62 +376,6 @@ void F_IntroDrawer(void) intro_curtime = introscenetime[intro_scenenum] - timetonext; - if (rendermode != render_none) - { - if (intro_scenenum == 5 && intro_curtime == 5*TICRATE) - { - patch_t *radar = W_CachePatchName("RADAR", PU_CACHE); - - F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); - V_DrawScaledPatch(0, 0, 0, radar); - W_UnlockCachedPatch(radar); - V_DrawString(8, 128, 0, cutscene_disptext); - - F_WipeEndScreen(); - F_RunWipe(99,true); - } - else if (intro_scenenum == 7 && intro_curtime == 6*TICRATE) // Force a wipe here - { - patch_t *grass = W_CachePatchName("SGRASS5", PU_CACHE); - - F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); - V_DrawScaledPatch(0, 0, 0, grass); - W_UnlockCachedPatch(grass); - V_DrawString(8, 128, 0, cutscene_disptext); - - F_WipeEndScreen(); - F_RunWipe(99,true); - } - else if (intro_scenenum == 12 && intro_curtime == 7*TICRATE) - { - patch_t *confront = W_CachePatchName("CONFRONT", PU_CACHE); - - F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); - V_DrawSmallScaledPatch(0, 0, 0, confront); - W_UnlockCachedPatch(confront); - V_DrawString(8, 128, 0, cutscene_disptext); - - F_WipeEndScreen(); - F_RunWipe(99,true); - } - if (intro_scenenum == 14 && intro_curtime == 7*TICRATE) - { - patch_t *sdo = W_CachePatchName("SONICDO2", PU_CACHE); - - F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); - V_DrawSmallScaledPatch(0, 0, 0, sdo); - W_UnlockCachedPatch(sdo); - V_DrawString(224, 8, 0, cutscene_disptext); - - F_WipeEndScreen(); - F_RunWipe(99,true); - } - } - F_IntroDrawScene(); } diff --git a/src/sounds.c b/src/sounds.c index 07777514..263df2aa 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -499,7 +499,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"mkitmF", true, 72, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"clash", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, {"tossed", false,150, 8, -1, NULL, 0, -1, -1, LUMPERROR}, - {"shelit", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR}, + {"shelit", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR}, + {"vroom", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // SRB2kart - Skin sounds {"kwin", false, 64, 0, -1, NULL, 0, SKSWIN, -1, LUMPERROR}, diff --git a/src/sounds.h b/src/sounds.h index 66a9b729..4b5f3e6a 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -571,6 +571,7 @@ typedef enum sfx_clash, sfx_tossed, sfx_shelit, + sfx_vroom, sfx_kwin, sfx_klose, From e6ed15c0661489d1ea24e2e98f01d4e837fd3749 Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Wed, 25 Oct 2017 20:38:43 +0100 Subject: [PATCH 4/8] Separate music from sound.kart so it can be added properly --- src/d_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/d_main.c b/src/d_main.c index 2ac28b32..9cf7467c 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -877,6 +877,14 @@ static void IdentifyVersion(void) D_AddFile(musicpath); else if (ms == 0) I_Error("File %s has been modified with non-music lumps",musicfile); + + const char* kmusicfile = "music.kart"; + const char* kmusicpath = va(pandf,srb2waddir,kmusicfile); + ms = W_VerifyNMUSlumps(kmusicpath); + if (ms == 1) + D_AddFile(kmusicpath); + else if (ms == 0) + I_Error("File %s has been modified with non-music lumps",kmusicfile); } #endif } From 1f7caee344b127bfb19886d48f5b029936c0f161 Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Wed, 25 Oct 2017 23:05:19 +0100 Subject: [PATCH 5/8] Highres intro graphic --- src/f_finale.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/f_finale.c b/src/f_finale.c index e6bfa7e8..8faace23 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -312,6 +312,7 @@ static void F_IntroDrawScene(void) S_StartSound(NULL, rsound); } background = W_CachePatchName("KARTKREW", PU_CACHE); + highres = true; } V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120); From a551ecc1664e4474bab5b98b0b6bea67c047d4f7 Mon Sep 17 00:00:00 2001 From: Wolfy Date: Thu, 26 Oct 2017 01:43:02 -0500 Subject: [PATCH 6/8] Reorganize the control setup menu, update controls to reflect kart --- src/m_menu.c | 76 +++++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index a0e4e3e8..14110f2b 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -272,7 +272,7 @@ static void M_SetupMultiPlayer2(INT32 choice); // Split into multiple parts due to size // Controls menu_t OP_ControlsDef, OP_ControlListDef, OP_MoveControlsDef; -menu_t OP_MPControlsDef, OP_CameraControlsDef, OP_MiscControlsDef; +menu_t /*OP_MPControlsDef,*/ OP_CameraControlsDef, OP_MiscControlsDef; menu_t OP_P1ControlsDef, OP_P2ControlsDef, OP_MouseOptionsDef; menu_t OP_Mouse2OptionsDef, OP_Joystick1Def, OP_Joystick2Def; static void M_VideoModeMenu(INT32 choice); @@ -1032,30 +1032,29 @@ static menuitem_t OP_P2ControlsMenu[] = static menuitem_t OP_ControlListMenu[] = { - {IT_SUBMENU | IT_STRING, NULL, "Movement Controls...", &OP_MoveControlsDef, 10}, - {IT_SUBMENU | IT_STRING, NULL, "Multiplayer Controls...", &OP_MPControlsDef, 20}, - {IT_SUBMENU | IT_STRING, NULL, "Camera Controls...", &OP_CameraControlsDef, 30}, - {IT_SUBMENU | IT_STRING, NULL, "Miscellaneous Controls...", &OP_MiscControlsDef, 40}, + {IT_SUBMENU | IT_STRING, NULL, "Kart Controls...", &OP_MoveControlsDef, 10}, +// {IT_SUBMENU | IT_STRING, NULL, "Multiplayer Controls...", &OP_MPControlsDef, 20}, + {IT_SUBMENU | IT_STRING, NULL, "Camera Controls...", &OP_CameraControlsDef, 20}, + {IT_SUBMENU | IT_STRING, NULL, "Miscellaneous Controls...", &OP_MiscControlsDef, 30}, }; static menuitem_t OP_MoveControlsMenu[] = { - {IT_CALL | IT_STRING2, NULL, "Forward", M_ChangeControl, gc_forward }, - {IT_CALL | IT_STRING2, NULL, "Reverse", M_ChangeControl, gc_backward }, - {IT_CALL | IT_STRING2, NULL, "Turn Left", M_ChangeControl, gc_turnleft }, - {IT_CALL | IT_STRING2, NULL, "Turn Right", M_ChangeControl, gc_turnright }, - {IT_CALL | IT_STRING2, NULL, "Jump", M_ChangeControl, gc_jump }, - {IT_CALL | IT_STRING2, NULL, "Brake", M_ChangeControl, gc_brake }, - {IT_CALL | IT_STRING2, NULL, "Strafe Left", M_ChangeControl, gc_strafeleft }, - {IT_CALL | IT_STRING2, NULL, "Strafe Right", M_ChangeControl, gc_straferight}, + {IT_CALL | IT_STRING2, NULL, "Forward", M_ChangeControl, gc_forward }, + {IT_CALL | IT_STRING2, NULL, "Reverse", M_ChangeControl, gc_backward }, + {IT_CALL | IT_STRING2, NULL, "Turn Left", M_ChangeControl, gc_turnleft }, + {IT_CALL | IT_STRING2, NULL, "Turn Right", M_ChangeControl, gc_turnright }, + {IT_CALL | IT_STRING2, NULL, "Accelerate", M_ChangeControl, gc_accelerate }, + {IT_CALL | IT_STRING2, NULL, "Drift", M_ChangeControl, gc_jump }, + {IT_CALL | IT_STRING2, NULL, "Brake", M_ChangeControl, gc_brake }, + {IT_CALL | IT_STRING2, NULL, "Use/Throw Item", M_ChangeControl, gc_fire }, +// {IT_CALL | IT_STRING2, NULL, "Strafe Left", M_ChangeControl, gc_strafeleft }, +// {IT_CALL | IT_STRING2, NULL, "Strafe Right", M_ChangeControl, gc_straferight}, }; -static menuitem_t OP_MPControlsMenu[] = +// Obsolete thanks to Kart +/*static menuitem_t OP_MPControlsMenu[] = { - {IT_CALL | IT_STRING2, NULL, "Talk key", M_ChangeControl, gc_talkkey }, - {IT_CALL | IT_STRING2, NULL, "Team-Talk key", M_ChangeControl, gc_teamkey }, - {IT_CALL | IT_STRING2, NULL, "Rankings/Scores", M_ChangeControl, gc_scores }, - {IT_CALL | IT_STRING2, NULL, "Spectate", M_ChangeControl, gc_spectate }, // {IT_CALL | IT_STRING2, NULL, "Next Weapon", M_ChangeControl, gc_driftleft }, // {IT_CALL | IT_STRING2, NULL, "Prev Weapon", M_ChangeControl, gc_driftright }, // {IT_CALL | IT_STRING2, NULL, "Weapon Slot 1", M_ChangeControl, gc_wepslot1 }, @@ -1065,9 +1064,7 @@ static menuitem_t OP_MPControlsMenu[] = // {IT_CALL | IT_STRING2, NULL, "Weapon Slot 5", M_ChangeControl, gc_wepslot5 }, // {IT_CALL | IT_STRING2, NULL, "Weapon Slot 6", M_ChangeControl, gc_wepslot6 }, // {IT_CALL | IT_STRING2, NULL, "Weapon Slot 7", M_ChangeControl, gc_wepslot7 }, - {IT_CALL | IT_STRING2, NULL, "Ring Toss", M_ChangeControl, gc_fire }, - {IT_CALL | IT_STRING2, NULL, "Accelerate", M_ChangeControl, gc_accelerate }, -}; +};*/ static menuitem_t OP_CameraControlsMenu[] = { @@ -1089,6 +1086,11 @@ static menuitem_t OP_MiscControlsMenu[] = {IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause }, {IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console }, + + {IT_CALL | IT_STRING2, NULL, "Talk key", M_ChangeControl, gc_talkkey }, + {IT_CALL | IT_STRING2, NULL, "Team-Talk key", M_ChangeControl, gc_teamkey }, + {IT_CALL | IT_STRING2, NULL, "Rankings/Scores", M_ChangeControl, gc_scores }, + {IT_CALL | IT_STRING2, NULL, "Spectate", M_ChangeControl, gc_spectate }, }; static menuitem_t OP_Joystick1Menu[] = @@ -1358,26 +1360,28 @@ static menuitem_t OP_NetgameOptionsMenu[] = static menuitem_t OP_GametypeOptionsMenu[] = { - {IT_HEADER, NULL, "CO-OP", NULL, 2}, + // This is Kart, we don't need half this shit! +/* {IT_HEADER, NULL, "CO-OP", NULL, 2}, {IT_STRING | IT_CVAR, NULL, "Players for exit", &cv_playersforexit, 10}, {IT_STRING | IT_CVAR, NULL, "Starting Lives", &cv_startinglives, 18}, {IT_HEADER, NULL, "COMPETITION", NULL, 34}, {IT_STRING | IT_CVAR, NULL, "Item Boxes", &cv_competitionboxes, 42}, - {IT_STRING | IT_CVAR, NULL, "Countdown Time", &cv_countdowntime, 50}, + {IT_STRING | IT_CVAR, NULL, "Countdown Time", &cv_countdowntime, 50},*/ - {IT_HEADER, NULL, "RACE", NULL, 66}, - {IT_STRING | IT_CVAR, NULL, "Number of Laps", &cv_numlaps, 74}, - {IT_STRING | IT_CVAR, NULL, "Use Map Lap Counts", &cv_usemapnumlaps, 82}, + {IT_HEADER, NULL, "RACE", NULL, 2}, + {IT_STRING | IT_CVAR, NULL, "Number of Laps", &cv_numlaps, 10}, + {IT_STRING | IT_CVAR, NULL, "Use Map Lap Counts", &cv_usemapnumlaps, 18}, + {IT_STRING | IT_CVAR, NULL, "CC", &cv_kartcc, 26}, - {IT_HEADER, NULL, "MATCH", NULL, 98}, - {IT_STRING | IT_CVAR, NULL, "Scoring Type", &cv_match_scoring, 106}, + {IT_HEADER, NULL, "BATTLE", NULL, 50}, +/* {IT_STRING | IT_CVAR, NULL, "Scoring Type", &cv_match_scoring, 106}, {IT_HEADER, NULL, "TAG", NULL, 122}, {IT_STRING | IT_CVAR, NULL, "Hide Time", &cv_hidetime, 130}, {IT_HEADER, NULL, "CTF", NULL, 146}, - {IT_STRING | IT_CVAR, NULL, "Flag Respawn Time", &cv_flagtime, 154}, + {IT_STRING | IT_CVAR, NULL, "Flag Respawn Time", &cv_flagtime, 154},*/ }; static menuitem_t OP_MonitorToggleMenu[] = @@ -1668,7 +1672,7 @@ menu_t OP_MainDef = DEFAULTMENUSTYLE("M_OPTTTL", OP_MainMenu, &MainDef, 60, 30); menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30); menu_t OP_ControlListDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlListMenu, &OP_ControlsDef, 60, 30); menu_t OP_MoveControlsDef = CONTROLMENUSTYLE(OP_MoveControlsMenu, &OP_ControlListDef); -menu_t OP_MPControlsDef = CONTROLMENUSTYLE(OP_MPControlsMenu, &OP_ControlListDef); +//menu_t OP_MPControlsDef = CONTROLMENUSTYLE(OP_MPControlsMenu, &OP_ControlListDef); menu_t OP_CameraControlsDef = CONTROLMENUSTYLE(OP_CameraControlsMenu, &OP_ControlListDef); menu_t OP_MiscControlsDef = CONTROLMENUSTYLE(OP_MiscControlsMenu, &OP_ControlListDef); menu_t OP_P1ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P1ControlsMenu, &OP_ControlsDef, 60, 30); @@ -6869,9 +6873,9 @@ static void M_Setup1PControlsMenu(INT32 choice) currentMenu->lastOn = itemOn; // Unhide the three non-P2 controls - OP_MPControlsMenu[0].status = IT_CALL|IT_STRING2; - OP_MPControlsMenu[1].status = IT_CALL|IT_STRING2; - OP_MPControlsMenu[2].status = IT_CALL|IT_STRING2; + //OP_MPControlsMenu[0].status = IT_CALL|IT_STRING2; + //OP_MPControlsMenu[1].status = IT_CALL|IT_STRING2; + //OP_MPControlsMenu[2].status = IT_CALL|IT_STRING2; // Unide the pause/console controls too OP_MiscControlsMenu[3].status = IT_CALL|IT_STRING2; OP_MiscControlsMenu[4].status = IT_CALL|IT_STRING2; @@ -6888,9 +6892,9 @@ static void M_Setup2PControlsMenu(INT32 choice) currentMenu->lastOn = itemOn; // Hide the three non-P2 controls - OP_MPControlsMenu[0].status = IT_GRAYEDOUT2; - OP_MPControlsMenu[1].status = IT_GRAYEDOUT2; - OP_MPControlsMenu[2].status = IT_GRAYEDOUT2; + //OP_MPControlsMenu[0].status = IT_GRAYEDOUT2; + //OP_MPControlsMenu[1].status = IT_GRAYEDOUT2; + //OP_MPControlsMenu[2].status = IT_GRAYEDOUT2; // Hide the pause/console controls too OP_MiscControlsMenu[3].status = IT_GRAYEDOUT2; OP_MiscControlsMenu[4].status = IT_GRAYEDOUT2; From 8742b3b2d99d9982c6712495ef7aabff502bd065 Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Thu, 26 Oct 2017 20:04:05 +0100 Subject: [PATCH 7/8] Star power translation tables Redid the part that handled the regular kart translation tables too, now uses the new table created instead of the horror of what was there before --- src/hardware/hw_main.c | 9 +- src/k_kart.c | 211 +++++++++++++++++++++-------------------- src/r_draw.c | 4 +- src/r_draw.h | 1 + src/r_things.c | 18 +++- 5 files changed, 134 insertions(+), 109 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 15753fb4..ac601c9f 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5263,8 +5263,13 @@ static void HWR_ProjectSprite(mobj_t *thing) // New colormap stuff for skins Tails 06-07-2002 if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player! { - size_t skinnum = (skin_t*)thing->skin-skins; - vis->colormap = R_GetTranslationColormap((INT32)skinnum, thing->color, GTC_CACHE); + if (thing->player && thing->player->kartstuff[k_startimer]) + vis->colormap = R_GetTranslationColormap(TC_STARMAN, thing->color, GTC_CACHE); + else + { + size_t skinnum = (skin_t*)thing->skin-skins; + vis->colormap = R_GetTranslationColormap((INT32)skinnum, thing->color, GTC_CACHE); + } } else vis->colormap = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color ? vis->mobj->color : SKINCOLOR_CYAN, GTC_CACHE); diff --git a/src/k_kart.c b/src/k_kart.c index 9a00b3ce..75b6a652 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -94,42 +94,114 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Indigo" // 63 // SKINCOLOR_INDIGO }; -/** \brief Generates a simple case table for given values. Not very optimal, but makes it easy to read in K_GenerateKartColormap. +UINT8 colortranslations[MAXSKINCOLORS][16] = { + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // SKINCOLOR_NONE + {120, 120, 120, 120, 0, 0, 0, 0, 1, 1, 2, 2, 4, 6, 8, 10}, // SKINCOLOR_IVORY + { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7}, // SKINCOLOR_WHITE + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, // SKINCOLOR_SILVER + { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31}, // SKINCOLOR_CLOUDY + { 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, // SKINCOLOR_GREY + { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}, // SKINCOLOR_DARKGREY + { 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_BLACK + {120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127}, // SKINCOLOR_SALMON + {144, 144, 145, 145, 146, 146, 147, 147, 148, 148, 149, 149, 150, 150, 151, 151}, // SKINCOLOR_PINK + {120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135}, // SKINCOLOR_LIGHTRED + {120, 121, 123, 124, 126, 127, 129, 130, 132, 133, 135, 136, 138, 139, 141, 143}, // SKINCOLOR_SHINYRED + {125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140}, // SKINCOLOR_RED + {144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_DARKPINK + {136, 136, 137, 137, 138, 138, 139, 139, 140, 140, 141, 141, 142, 142, 143, 143}, // SKINCOLOR_DARKRED + {120, 121, 122, 123, 124, 147, 88, 89, 149, 91, 92, 151, 94, 95, 152, 153}, // SKINCOLOR_DAWN + { 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95}, // SKINCOLOR_ORANGE + { 80, 81, 83, 85, 86, 88, 90, 91, 93, 95, 152, 153, 154, 156, 157, 159}, // SKINCOLOR_SHINYORANGE + { 88, 89, 90, 91, 92, 93, 94, 95, 152, 153, 154, 155, 156, 157, 158, 159}, // SKINCOLOR_DARKORANGE + {112, 113, 114, 115, 116, 117, 118, 119, 156, 156, 157, 157, 158, 158, 159, 159}, // SKINCOLOR_GOLDENBROWN + {152, 152, 153, 153, 154, 154, 155, 155, 156, 156, 157, 157, 158, 158, 159, 159}, // SKINCOLOR_ROSEWOOD + {152, 153, 154, 155, 156, 157, 158, 159, 139, 140, 141, 142, 143, 31, 31, 31}, // SKINCOLOR_DARKROSEWOOD + { 3, 5, 7, 32, 9, 34, 36, 37, 39, 42, 45, 59, 60, 61, 62, 63}, // SKINCOLOR_SEPIA + { 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}, // SKINCOLOR_BEIGE + { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}, // SKINCOLOR_BROWN + { 57, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 28, 29, 30, 31}, // SKINCOLOR_LEATHER + { 97, 98, 99, 100, 101, 102, 103, 104, 113, 113, 114, 115, 115, 115, 116, 117}, // SKINCOLOR_YELLOW + { 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79}, // SKINCOLOR_PEACH + { 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87}, // SKINCOLOR_LIGHTORANGE + { 72, 73, 74, 75, 76, 77, 78, 79, 48, 49, 50, 51, 52, 53, 54, 55}, // SKINCOLOR_CARAMEL + {112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119}, // SKINCOLOR_GOLD + { 64, 66, 68, 70, 72, 74, 76, 78, 48, 50, 52, 54, 56, 58, 60, 62}, // SKINCOLOR_SHINYCARAMEL + {121, 144, 145, 72, 73, 84, 114, 115, 107, 108, 109, 183, 223, 207, 30, 246}, // SKINCOLOR_VOMIT + { 98, 99, 112, 101, 113, 114, 106, 179, 180, 181, 182, 172, 183, 173, 174, 175}, // SKINCOLOR_GARDEN + {176, 176, 176, 176, 177, 177, 177, 177, 178, 178, 178, 178, 179, 179, 179, 179}, // SKINCOLOR_LIGHTARMY + {176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 181, 182, 182, 183, 183}, // SKINCOLOR_ARMY + {176, 176, 177, 177, 178, 178, 179, 179, 166, 167, 168, 169, 170, 171, 172, 173}, // SKINCOLOR_PISTACHIO + {177, 177, 178, 178, 165, 165, 167, 167, 182, 182, 171, 171, 183, 183, 173, 173}, // SKINCOLOR_ROBOHOOD + {105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 31, 31}, // SKINCOLOR_OLIVE + {176, 177, 178, 179, 170, 181, 182, 183, 173, 173, 174, 174, 175, 175, 31, 31}, // SKINCOLOR_DARKARMY + {160, 160, 161, 161, 162, 162, 163, 163, 164, 164, 165, 165, 166, 166, 167, 167}, // SKINCOLOR_LIGHTGREEN + {184, 184, 184, 184, 185, 185, 185, 185, 186, 186, 186, 186, 187, 187, 187, 187}, // SKINCOLOR_UGLYGREEN + {184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 190, 191, 191}, // SKINCOLOR_NEONGREEN + {160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175}, // SKINCOLOR_GREEN + {168, 168, 169, 169, 170, 170, 171, 171, 172, 172, 173, 173, 174, 174, 175, 175}, // SKINCOLOR_DARKGREEN + {187, 187, 188, 188, 189, 189, 190, 190, 191, 191, 175, 175, 30, 30, 31, 31}, // SKINCOLOR_SWAMP + {224, 225, 226, 212, 213, 213, 214, 215, 220, 221, 172, 222, 173, 223, 174, 175}, // SKINCOLOR_FROST + {200, 200, 200, 200, 201, 201, 201, 201, 202, 202, 202, 202, 203, 203, 203, 203}, // SKINCOLOR_SLATE + {224, 224, 225, 225, 226, 226, 227, 227, 228, 228, 229, 229, 230, 230, 231, 231}, // SKINCOLOR_LIGHTBLUE + {208, 208, 209, 210, 210, 211, 212, 213, 213, 214, 215, 216, 216, 217, 218, 219}, // SKINCOLOR_CYAN + {216, 216, 216, 216, 217, 217, 217, 217, 218, 218, 218, 218, 219, 219, 219, 219}, // SKINCOLOR_CERULEAN + {208, 208, 209, 210, 210, 211, 212, 213, 213, 214, 215, 220, 220, 221, 222, 223}, // SKINCOLOR_TURQOISE + {220, 220, 220, 220, 221, 221, 221, 221, 222, 222, 222, 222, 223, 223, 223, 223}, // SKINCOLOR_TEAL + {200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 206, 207, 207}, // SKINCOLOR_STEELBLUE + {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239}, // SKINCOLOR_BLUE + {224, 225, 226, 228, 229, 231, 232, 234, 235, 237, 238, 240, 241, 243, 244, 246}, // SKINCOLOR_SHINYBLUE + {200, 201, 202, 203, 204, 205, 206, 238, 239, 240, 241, 242, 243, 244, 245, 246}, // SKINCOLOR_NAVY + {231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246}, // SKINCOLOR_DARKBLUE + {200, 201, 202, 203, 204, 205, 206, 207, 28, 28, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_JETBLACK + {120, 120, 121, 121, 122, 122, 123, 123, 192, 192, 248, 248, 249, 249, 250, 250}, // SKINCOLOR_LILAC + {192, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199, 199}, // SKINCOLOR_PURPLE + {248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 254, 255, 255}, // SKINCOLOR_LAVENDER + {192, 248, 249, 250, 251, 252, 253, 254, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_BYZANTIUM + {192, 193, 194, 195, 196, 197, 198, 199, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_INDIGO + /* Removed Colours + {192, 192, 248, 249, 250, 251, 229, 204, 230, 205, 206, 239, 240, 241, 242, 243}, // SKINCOLOR_DUSK + { 1, 145, 125, 73, 83, 114, 106, 180, 187, 168, 219, 205, 236, 206, 199, 255}, // SKINCOLOR_RAINBOW + */ +}; - \param i loop iteration - \param cNumber Numeric color value, from Zero to Fifteen +/** \brief Generates the starman colourmaps that are used when a player has the invincibility power - \return INT32 Returns the pulled value of the sixteen fed to it + \param dest_colormap colormap to populate + \param skincolor translation color */ -static INT32 R_KartColorSetter(UINT8 i, - INT32 cZero, INT32 cOne, INT32 cTwo, INT32 cThree, - INT32 cFour, INT32 cFive, INT32 cSix, INT32 cSeven, - INT32 cEight, INT32 cNine, INT32 cTen, INT32 cEleven, - INT32 cTwelve, INT32 cThirteen, INT32 cFourteen, INT32 cFifteen) +void K_StarmanColormap(UINT8 *dest_colormap, UINT8 skincolor) { - INT32 ThisColorIs = 0; + INT32 i, j; + RGBA_t color; + UINT8 colorbrightnesses[16]; + UINT8 brightness; + UINT16 brightdif; + INT32 temp; - switch (i) + // first generate the brightness of all the colours of that skincolour + for (i = 0; i < 16; i++) { - case 0: ThisColorIs = cZero; break; - case 1: ThisColorIs = cOne; break; - case 2: ThisColorIs = cTwo; break; - case 3: ThisColorIs = cThree; break; - case 4: ThisColorIs = cFour; break; - case 5: ThisColorIs = cFive; break; - case 6: ThisColorIs = cSix; break; - case 7: ThisColorIs = cSeven; break; - case 8: ThisColorIs = cEight; break; - case 9: ThisColorIs = cNine; break; - case 10: ThisColorIs = cTen; break; - case 11: ThisColorIs = cEleven; break; - case 12: ThisColorIs = cTwelve; break; - case 13: ThisColorIs = cThirteen; break; - case 14: ThisColorIs = cFourteen; break; - case 15: ThisColorIs = cFifteen; break; + color = V_GetColor(colortranslations[skincolor][i]); + colorbrightnesses[i] = (UINT8)(((UINT16)color.s.red + (UINT16)color.s.green + (UINT16)color.s.blue)/3); } - return ThisColorIs; + // next, for every colour in the palette, choose the transcolor that has the closest brightness + for (i = 0; i < NUM_PALETTE_ENTRIES; i++) + { + color = V_GetColor(i); + brightness = (UINT8)(((UINT16)color.s.red + (UINT16)color.s.green + (UINT16)color.s.blue)/3); + brightdif = 256; + for (j = 0; j < 16; j++) + { + temp = abs((INT16)brightness - (INT16)colorbrightnesses[j]); + if (temp < brightdif) + { + brightdif = (UINT16)temp; + dest_colormap[i] = colortranslations[skincolor][j]; + } + } + } } /** \brief Generates a translation colormap for Kart, to replace R_GenerateTranslationColormap in r_draw.c @@ -162,6 +234,11 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color) return; } + else if (skinnum == TC_STARMAN) + { + K_StarmanColormap(dest_colormap, color); + return; + } starttranscolor = (skinnum != TC_DEFAULT) ? skins[skinnum].starttranscolor : DEFAULT_STARTTRANSCOLOR; @@ -174,80 +251,10 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color) // Build the translated ramp for (i = 0; i < SKIN_RAMP_LENGTH; i++) - switch (color) - { - case SKINCOLOR_IVORY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 120, 120, 120, 120, 0, 0, 0, 0, 1, 1, 2, 2, 4, 6, 8, 10); break; - case SKINCOLOR_WHITE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7); break; - case SKINCOLOR_SILVER: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); break; - case SKINCOLOR_CLOUDY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31); break; - case SKINCOLOR_GREY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23); break; - case SKINCOLOR_DARKGREY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); break; - case SKINCOLOR_BLACK: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31); break; - case SKINCOLOR_SALMON: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127); break; - case SKINCOLOR_PINK: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 144, 144, 145, 145, 146, 146, 147, 147, 148, 148, 149, 149, 150, 150, 151, 151); break; - case SKINCOLOR_LIGHTRED: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135); break; - case SKINCOLOR_SHINYRED: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 120, 121, 123, 124, 126, 127, 129, 130, 132, 133, 135, 136, 138, 139, 141, 143); break; - case SKINCOLOR_RED: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140); break; - case SKINCOLOR_DARKPINK: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141); break; - case SKINCOLOR_DARKRED: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 136, 136, 137, 137, 138, 138, 139, 139, 140, 140, 141, 141, 142, 142, 143, 143); break; - case SKINCOLOR_DAWN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 120, 121, 122, 123, 124, 147, 88, 89, 149, 91, 92, 151, 94, 95, 152, 153); break; - case SKINCOLOR_ORANGE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95); break; - case SKINCOLOR_SHINYORANGE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 80, 81, 83, 85, 86, 88, 90, 91, 93, 95, 152, 153, 154, 156, 157, 159); break; - case SKINCOLOR_DARKORANGE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 88, 89, 90, 91, 92, 93, 94, 95, 152, 153, 154, 155, 156, 157, 158, 159); break; - case SKINCOLOR_GOLDENBROWN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 112, 113, 114, 115, 116, 117, 118, 119, 156, 156, 157, 157, 158, 158, 159, 159); break; - case SKINCOLOR_ROSEWOOD: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 152, 152, 153, 153, 154, 154, 155, 155, 156, 156, 157, 157, 158, 158, 159, 159); break; - case SKINCOLOR_DARKROSEWOOD: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 152, 153, 154, 155, 156, 157, 158, 159, 139, 140, 141, 142, 143, 31, 31, 31); break; - case SKINCOLOR_SEPIA: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 3, 5, 7, 32, 9, 34, 36, 37, 39, 42, 45, 59, 60, 61, 62, 63); break; - case SKINCOLOR_BEIGE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47); break; - case SKINCOLOR_BROWN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63); break; - case SKINCOLOR_LEATHER: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 57, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 28, 29, 30, 31); break; - case SKINCOLOR_YELLOW: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 97, 98, 99, 100, 101, 102, 103, 104, 113, 113, 114, 115, 115, 115, 116, 117); break; - case SKINCOLOR_PEACH: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79); break; - case SKINCOLOR_LIGHTORANGE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87); break; - case SKINCOLOR_CARAMEL: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 72, 73, 74, 75, 76, 77, 78, 79, 48, 49, 50, 51, 52, 53, 54, 55); break; - case SKINCOLOR_GOLD: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119); break; - case SKINCOLOR_SHINYCARAMEL: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 64, 66, 68, 70, 72, 74, 76, 78, 48, 50, 52, 54, 56, 58, 60, 62); break; - case SKINCOLOR_VOMIT: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 121, 144, 145, 72, 73, 84, 114, 115, 107, 108, 109, 183, 223, 207, 30, 246); break; - case SKINCOLOR_GARDEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 98, 99, 112, 101, 113, 114, 106, 179, 180, 181, 182, 172, 183, 173, 174, 175); break; - case SKINCOLOR_LIGHTARMY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 176, 176, 176, 176, 177, 177, 177, 177, 178, 178, 178, 178, 179, 179, 179, 179); break; - case SKINCOLOR_ARMY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 181, 182, 182, 183, 183); break; - case SKINCOLOR_PISTACHIO: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 176, 176, 177, 177, 178, 178, 179, 179, 166, 167, 168, 169, 170, 171, 172, 173); break; - case SKINCOLOR_ROBOHOOD: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 177, 177, 178, 178, 165, 165, 167, 167, 182, 182, 171, 171, 183, 183, 173, 173); break; - case SKINCOLOR_OLIVE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 31, 31); break; - case SKINCOLOR_DARKARMY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 176, 177, 178, 179, 170, 181, 182, 183, 173, 173, 174, 174, 175, 175, 31, 31); break; - case SKINCOLOR_LIGHTGREEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 160, 160, 161, 161, 162, 162, 163, 163, 164, 164, 165, 165, 166, 166, 167, 167); break; - case SKINCOLOR_UGLYGREEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 184, 184, 184, 184, 185, 185, 185, 185, 186, 186, 186, 186, 187, 187, 187, 187); break; - case SKINCOLOR_NEONGREEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 190, 191, 191); break; - case SKINCOLOR_GREEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175); break; - case SKINCOLOR_DARKGREEN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 168, 168, 169, 169, 170, 170, 171, 171, 172, 172, 173, 173, 174, 174, 175, 175); break; - case SKINCOLOR_SWAMP: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 187, 187, 188, 188, 189, 189, 190, 190, 191, 191, 175, 175, 30, 30, 31, 31); break; - case SKINCOLOR_FROST: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 224, 225, 226, 212, 213, 213, 214, 215, 220, 221, 172, 222, 173, 223, 174, 175); break; - case SKINCOLOR_SLATE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 200, 200, 200, 200, 201, 201, 201, 201, 202, 202, 202, 202, 203, 203, 203, 203); break; - case SKINCOLOR_LIGHTBLUE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 224, 224, 225, 225, 226, 226, 227, 227, 228, 228, 229, 229, 230, 230, 231, 231); break; - case SKINCOLOR_CYAN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 208, 208, 209, 210, 210, 211, 212, 213, 213, 214, 215, 216, 216, 217, 218, 219); break; - case SKINCOLOR_CERULEAN: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 216, 216, 216, 216, 217, 217, 217, 217, 218, 218, 218, 218, 219, 219, 219, 219); break; - case SKINCOLOR_TURQUOISE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 208, 208, 209, 210, 210, 211, 212, 213, 213, 214, 215, 220, 220, 221, 222, 223); break; - case SKINCOLOR_TEAL: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 220, 220, 220, 220, 221, 221, 221, 221, 222, 222, 222, 222, 223, 223, 223, 223); break; - case SKINCOLOR_STEELBLUE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 206, 207, 207); break; - case SKINCOLOR_BLUE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239); break; - case SKINCOLOR_SHINYBLUE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 224, 225, 226, 228, 229, 231, 232, 234, 235, 237, 238, 240, 241, 243, 244, 246); break; - case SKINCOLOR_NAVY: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 200, 201, 202, 203, 204, 205, 206, 238, 239, 240, 241, 242, 243, 244, 245, 246); break; - case SKINCOLOR_DARKBLUE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246); break; - case SKINCOLOR_JETBLACK: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 200, 201, 202, 203, 204, 205, 206, 207, 28, 28, 29, 29, 30, 30, 31, 31); break; - case SKINCOLOR_LILAC: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 120, 120, 121, 121, 122, 122, 123, 123, 192, 192, 248, 248, 249, 249, 250, 250); break; - case SKINCOLOR_PURPLE: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 192, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199, 199); break; - case SKINCOLOR_LAVENDER: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 254, 255, 255); break; - case SKINCOLOR_BYZANTIUM: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 192, 248, 249, 250, 251, 252, 253, 254, 255, 255, 29, 29, 30, 30, 31, 31); break; - case SKINCOLOR_INDIGO: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 192, 193, 194, 195, 196, 197, 198, 199, 255, 255, 29, 29, 30, 30, 31, 31); break; - /* - * Removed Colors: - * case SKINCOLOR_DUSK: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 192, 192, 248, 249, 250, 251, 229, 204, 230, 205, 206, 239, 240, 241, 242, 243); break; - * case SKINCOLOR_RAINBOW: dest_colormap[starttranscolor + i] = R_KartColorSetter(i, 1, 145, 125, 73, 83, 114, 106, 180, 187, 168, 219, 205, 236, 206, 199, 255); break; - */ - default: - I_Error("Invalid skin color #%hu.", (UINT16)color); - return; - } + { + // Sryder 2017-10-26: What was here before was most definitely not particularly readable, check above for new color translation table + dest_colormap[starttranscolor + i] = colortranslations[color][i]; + } } /** \brief Pulls kart color by name, to replace R_GetColorByName in r_draw.c diff --git a/src/r_draw.c b/src/r_draw.c index 2100b272..ac7d263d 100644 --- a/src/r_draw.c +++ b/src/r_draw.c @@ -127,11 +127,12 @@ 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 STARMAN_TT_CACHE_INDEX (MAXSKINS + 4) #define SKIN_RAMP_LENGTH 16 #define DEFAULT_STARTTRANSCOLOR 160 #define NUM_PALETTE_ENTRIES 256 -static UINT8** translationtablecache[MAXSKINS + 4] = {NULL}; +static UINT8** translationtablecache[MAXSKINS + 5] = {NULL}; // See also the enum skincolors_t @@ -520,6 +521,7 @@ UINT8* R_GetTranslationColormap(INT32 skinnum, skincolors_t color, UINT8 flags) else if (skinnum == TC_BOSS) skintableindex = BOSS_TT_CACHE_INDEX; else if (skinnum == TC_METALSONIC) skintableindex = METALSONIC_TT_CACHE_INDEX; else if (skinnum == TC_ALLWHITE) skintableindex = ALLWHITE_TT_CACHE_INDEX; + else if (skinnum == TC_STARMAN) skintableindex = STARMAN_TT_CACHE_INDEX; else skintableindex = skinnum; if (flags & GTC_CACHE) diff --git a/src/r_draw.h b/src/r_draw.h index 6d85bd6a..419586c6 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -105,6 +105,7 @@ extern lumpnum_t viewborderlump[8]; #define TC_BOSS -2 #define TC_METALSONIC -3 // For Metal Sonic battle #define TC_ALLWHITE -4 // For Cy-Brak-demon +#define TC_STARMAN -5 // For star power // Initialize color translation tables, for player rendering etc. void R_InitTranslationTables(void); diff --git a/src/r_things.c b/src/r_things.c index 1a8a69ce..0643dfd5 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -827,8 +827,13 @@ static void R_DrawVisSprite(vissprite_t *vis) dc_transmap = vis->transmap; if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // MT_GHOST LOOKS LIKE A PLAYER SO USE THE PLAYER TRANSLATION TABLES. >_> { - size_t skinnum = (skin_t*)vis->mobj->skin-skins; - dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE); + if (vis->mobj->player && vis->mobj->player->kartstuff[k_startimer]) + dc_translation = R_GetTranslationColormap(TC_STARMAN, vis->mobj->color, GTC_CACHE); + else + { + size_t skinnum = (skin_t*)vis->mobj->skin-skins; + dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE); + } } else // Use the defaults dc_translation = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color, GTC_CACHE); @@ -846,8 +851,13 @@ static void R_DrawVisSprite(vissprite_t *vis) // New colormap stuff for skins Tails 06-07-2002 if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // This thing is a player! { - size_t skinnum = (skin_t*)vis->mobj->skin-skins; - dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE); + if (vis->mobj->player && vis->mobj->player->kartstuff[k_startimer]) + dc_translation = R_GetTranslationColormap(TC_STARMAN, vis->mobj->color, GTC_CACHE); + else + { + size_t skinnum = (skin_t*)vis->mobj->skin-skins; + dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE); + } } else // Use the defaults dc_translation = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color, GTC_CACHE); From bd55a295bdf27f70f19a3600d49528897c8e9ef0 Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Thu, 26 Oct 2017 20:57:36 +0100 Subject: [PATCH 8/8] Skin colours for MD2s This isn't amazing, until I implement something better (probably not until 2.2) it will have to do --- src/hardware/hw_md2.c | 206 ++++++++++++++++++++++++++++++++---------- 1 file changed, 158 insertions(+), 48 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index aec1e406..e61177e8 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -963,21 +963,159 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, switch (color) { + case SKINCOLOR_IVORY: + blendcolor = V_GetColor(0); + break; case SKINCOLOR_WHITE: blendcolor = V_GetColor(3); break; case SKINCOLOR_SILVER: - blendcolor = V_GetColor(10); + blendcolor = V_GetColor(7); + break; + case SKINCOLOR_CLOUDY: + blendcolor = V_GetColor(13); break; case SKINCOLOR_GREY: blendcolor = V_GetColor(15); break; + case SKINCOLOR_DARKGREY: + blendcolor = V_GetColor(23); + break; case SKINCOLOR_BLACK: blendcolor = V_GetColor(27); break; - case SKINCOLOR_CYAN: + case SKINCOLOR_SALMON: + blendcolor = V_GetColor(123); + break; + case SKINCOLOR_PINK: + blendcolor = V_GetColor(147); + break; + case SKINCOLOR_LIGHTRED: + blendcolor = V_GetColor(127); + break; + case SKINCOLOR_SHINYRED: + blendcolor = V_GetColor(130); + break; + case SKINCOLOR_RED: + blendcolor = V_GetColor(132); + break; + case SKINCOLOR_DARKPINK: + blendcolor = V_GetColor(151); + break; + case SKINCOLOR_DARKRED: + blendcolor = V_GetColor(139); + break; + case SKINCOLOR_DAWN: + blendcolor = V_GetColor(89); + break; + case SKINCOLOR_ORANGE: + blendcolor = V_GetColor(87); + break; + case SKINCOLOR_SHINYORANGE: + blendcolor = V_GetColor(91); + break; + case SKINCOLOR_DARKORANGE: + blendcolor = V_GetColor(95); + break; + case SKINCOLOR_GOLDENBROWN: + blendcolor = V_GetColor(119); + break; + case SKINCOLOR_ROSEWOOD: + blendcolor = V_GetColor(155); + break; + case SKINCOLOR_DARKROSEWOOD: + blendcolor = V_GetColor(159); + break; + case SKINCOLOR_SEPIA: + blendcolor = V_GetColor(37); + break; + case SKINCOLOR_BEIGE: + blendcolor = V_GetColor(39); + break; + case SKINCOLOR_BROWN: + blendcolor = V_GetColor(55); + break; + case SKINCOLOR_LEATHER: + blendcolor = V_GetColor(61); + break; + case SKINCOLOR_YELLOW: + blendcolor = V_GetColor(104); + break; + case SKINCOLOR_PEACH: + blendcolor = V_GetColor(71); + break; + case SKINCOLOR_LIGHTORANGE: + blendcolor = V_GetColor(83); + break; + case SKINCOLOR_CARAMEL: + blendcolor = V_GetColor(79); + break; + case SKINCOLOR_GOLD: + blendcolor = V_GetColor(115); + break; + case SKINCOLOR_SHINYCARAMEL: + blendcolor = V_GetColor(78); + break; + case SKINCOLOR_VOMIT: + blendcolor = V_GetColor(114); + break; + case SKINCOLOR_GARDEN: + blendcolor = V_GetColor(179); + break; + case SKINCOLOR_LIGHTARMY: + blendcolor = V_GetColor(177); + break; + case SKINCOLOR_ARMY: + blendcolor = V_GetColor(179); + break; + case SKINCOLOR_PISTACHIO: + blendcolor = V_GetColor(166); + break; + case SKINCOLOR_ROBOHOOD: + blendcolor = V_GetColor(182); + break; + case SKINCOLOR_OLIVE: + blendcolor = V_GetColor(108); + break; + case SKINCOLOR_DARKARMY: + blendcolor = V_GetColor(183); + break; + case SKINCOLOR_LIGHTGREEN: + blendcolor = V_GetColor(163); + break; + case SKINCOLOR_UGLYGREEN: + blendcolor = V_GetColor(185); + break; + case SKINCOLOR_NEONGREEN: + blendcolor = V_GetColor(187); + break; + case SKINCOLOR_GREEN: + blendcolor = V_GetColor(167); + break; + case SKINCOLOR_DARKGREEN: + blendcolor = V_GetColor(171); + break; + case SKINCOLOR_SWAMP: + blendcolor = V_GetColor(190); + break; + case SKINCOLOR_FROST: blendcolor = V_GetColor(215); break; + case SKINCOLOR_SLATE: + blendcolor = V_GetColor(201); + break; + case SKINCOLOR_LIGHTBLUE: + blendcolor = V_GetColor(227); + break; + case SKINCOLOR_CYAN: + blendcolor = V_GetColor(213); + break; + case SKINCOLOR_CERULEAN: + blendcolor = V_GetColor(217); + break; + case SKINCOLOR_TURQUOISE: + blendcolor = V_GetColor(220); + break; case SKINCOLOR_TEAL: blendcolor = V_GetColor(221); break; @@ -985,62 +1123,34 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, blendcolor = V_GetColor(203); break; case SKINCOLOR_BLUE: - blendcolor = V_GetColor(232); + blendcolor = V_GetColor(231); break; - case SKINCOLOR_PEACH: - blendcolor = V_GetColor(71); + case SKINCOLOR_SHINYBLUE: + blendcolor = V_GetColor(234); break; - /* - case SKINCOLOR_TAN: - blendcolor = V_GetColor(79); + case SKINCOLOR_NAVY: + blendcolor = V_GetColor(206); break; - */ - case SKINCOLOR_PINK: - blendcolor = V_GetColor(147); + case SKINCOLOR_DARKBLUE: + blendcolor = V_GetColor(238); break; - case SKINCOLOR_LAVENDER: - blendcolor = V_GetColor(251); + case SKINCOLOR_JETBLACK: + blendcolor = V_GetColor(207); + break; + case SKINCOLOR_LILAC: + blendcolor = V_GetColor(123); break; case SKINCOLOR_PURPLE: blendcolor = V_GetColor(195); break; - case SKINCOLOR_ORANGE: - blendcolor = V_GetColor(87); + case SKINCOLOR_LAVENDER: + blendcolor = V_GetColor(251); break; - case SKINCOLOR_ROSEWOOD: - blendcolor = V_GetColor(94); + case SKINCOLOR_BYZANTIUM: + blendcolor = V_GetColor(254); break; - case SKINCOLOR_BEIGE: - blendcolor = V_GetColor(40); - break; - case SKINCOLOR_BROWN: - blendcolor = V_GetColor(57); - break; - case SKINCOLOR_RED: - blendcolor = V_GetColor(130); - break; - case SKINCOLOR_DARKRED: - blendcolor = V_GetColor(139); - break; - case SKINCOLOR_NEONGREEN: - blendcolor = V_GetColor(184); - break; - case SKINCOLOR_GREEN: - blendcolor = V_GetColor(166); - break; - /* - case SKINCOLOR_ZIM: - blendcolor = V_GetColor(180); - break; - */ - case SKINCOLOR_OLIVE: - blendcolor = V_GetColor(108); - break; - case SKINCOLOR_YELLOW: - blendcolor = V_GetColor(104); - break; - case SKINCOLOR_GOLD: - blendcolor = V_GetColor(115); + case SKINCOLOR_INDIGO: + blendcolor = V_GetColor(199); break; case SKINCOLOR_SUPER1: