diff --git a/src/d_netcmd.c b/src/d_netcmd.c index e6ff6a42..e1e0a635 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -5252,7 +5252,7 @@ static void KartEncore_OnChange(void) CONS_Printf(M_GetText("Encore tracks will be turned %s next round.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); else { - CONS_Printf(M_GetText("Encore tracks has been turned %s.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); + CONS_Printf(M_GetText("Encore tracks have been turned %s.\n"), cv_kartencore.value ? M_GetText("on") : M_GetText("off")); encoremode = (boolean)cv_kartencore.value; } } diff --git a/src/p_setup.c b/src/p_setup.c index 30e882d5..196eb5c7 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2244,6 +2244,33 @@ static void P_LevelInitStuff(void) // and this stupid flag as a result players[i].pflags &= ~PF_TRANSFERTOCLOSEST; } + + // SRB2Kart: map load variables + if (modeattacking) // Just play it safe and set everything + { + gamespeed = 2; + encoremode = false; + franticitems = false; + comeback = true; + } + else + { + if (G_BattleGametype()) + { + gamespeed = 0; + encoremode = false; + } + else + { + gamespeed = (UINT8)cv_kartspeed.value; + encoremode = (boolean)cv_kartencore.value; + } + franticitems = (boolean)cv_kartfrantic.value; + comeback = (boolean)cv_kartcomeback.value; + } + + for (i = 0; i < 4; i++) + battlewanted[i] = -1; } // @@ -2618,23 +2645,31 @@ boolean P_SetupLevel(boolean skipprecip) // will be set by player think. players[consoleplayer].viewz = 1; - // Special stage fade to white + // Encore mode fade to pink to white // This is handled BEFORE sounds are stopped. - /*if (rendermode != render_none && G_IsSpecialStage(gamemap)) + if (rendermode != render_none && encoremode) { - tic_t starttime = I_GetTime(); - tic_t endtime = starttime + (3*TICRATE)/2; - tic_t nowtime; + tic_t starttime, endtime, nowtime; - S_StartSound(NULL, sfx_s3kaf); + S_StopMusic(); // er, about that... + + S_StartSound(NULL, sfx_ruby1); F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 122); F_WipeEndScreen(); F_RunWipe(wipedefs[wipe_speclevel_towhite], false); - nowtime = lastwipetic; + F_WipeStartScreen(); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120); + + F_WipeEndScreen(); + F_RunWipe(wipedefs[wipe_level_final], false); + + starttime = nowtime = lastwipetic; + endtime = starttime + (3*TICRATE)/2; + // Hold on white for extra effect. while (nowtime < endtime) { @@ -2647,23 +2682,22 @@ boolean P_SetupLevel(boolean skipprecip) } ranspecialwipe = 1; - }*/ + } // Make sure all sounds are stopped before Z_FreeTags. S_StopSounds(); S_ClearSfx(); - // As oddly named as this is, this handles music only. // We should be fine starting it here. S_Start(); // SRB2 Kart - Yes this is weird, but we don't want the music to start until after the countdown is finished // but we do still need the mapmusname to be changed if (leveltime < (starttime + (TICRATE/2))) - S_ChangeMusicInternal("kstart", false); //S_StopMusic(); + S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); //S_StopMusic(); - // Let's fade to black here - // But only if we didn't do the special stage wipe + // Let's fade to white here + // But only if we didn't do the encore wipe if (rendermode != render_none && !ranspecialwipe) { F_WipeStartScreen(); @@ -2726,33 +2760,6 @@ boolean P_SetupLevel(boolean skipprecip) // internal game map lastloadedmaplumpnum = W_GetNumForName(maplumpname = G_BuildMapName(gamemap)); - // SRB2Kart: map load variables - if (modeattacking) // Just play it safe and set everything - { - gamespeed = 2; - encoremode = false; - franticitems = false; - comeback = true; - } - else - { - if (G_BattleGametype()) - { - gamespeed = 0; - encoremode = false; - } - else - { - gamespeed = (UINT8)cv_kartspeed.value; - encoremode = (boolean)cv_kartencore.value; - } - franticitems = (boolean)cv_kartfrantic.value; - comeback = (boolean)cv_kartcomeback.value; - } - - for (i = 0; i < 4; i++) - battlewanted[i] = -1; - R_ReInitColormaps(mapheaderinfo[gamemap-1]->palette, (encoremode ? W_CheckNumForName(va("%sE", maplumpname)) : LUMPERROR)); CON_SetupBackColormap(); diff --git a/src/p_user.c b/src/p_user.c index 8f0f3dec..771161b3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1221,7 +1221,7 @@ void P_RestoreMusic(player_t *player) // Event - Level Start if (leveltime < (starttime + (TICRATE/2))) - S_ChangeMusicInternal("kstart", false); //S_StopMusic(); + S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); //S_StopMusic(); else // see also where time overs are handled - search for "lives = 2" in this file { // Item - Grow diff --git a/src/r_data.c b/src/r_data.c index 4719b908..1e2bc628 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -1151,14 +1151,14 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3) cg = ((HEX2INT(p1[3]) * 16) + HEX2INT(p1[4])); cb = ((HEX2INT(p1[5]) * 16) + HEX2INT(p1[6])); - // i don't know why this doesn't work... - /*if (encoremap) + if (encoremap) { - i = NearestColor(cr, cg, cb); - cr = pLocalPalette[encoremap[i]].s.red; - cg = pLocalPalette[encoremap[i]].s.green; - cb = pLocalPalette[encoremap[i]].s.blue; - }*/ + i = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; + //CONS_Printf("R_CreateColormap: encoremap[%d] = %d\n", i, encoremap[i]); -- moved encoremap upwards for optimisation + cr = pLocalPalette[i].s.red; + cg = pLocalPalette[i].s.green; + cb = pLocalPalette[i].s.blue; + } cmaskr = cr; cmaskg = cg; @@ -1208,14 +1208,13 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3) cg = ((HEX2INT(p3[3]) * 16) + HEX2INT(p3[4])); cb = ((HEX2INT(p3[5]) * 16) + HEX2INT(p3[6])); - // i don't know why this doesn't work... - /*if (encoremap) + if (encoremap) { - i = NearestColor(cr, cg, cb); - cr = pLocalPalette[encoremap[i]].s.red; - cg = pLocalPalette[encoremap[i]].s.green; - cb = pLocalPalette[encoremap[i]].s.blue; - }*/ + i = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; + cr = pLocalPalette[i].s.red; + cg = pLocalPalette[i].s.green; + cb = pLocalPalette[i].s.blue; + } cdestr = cr; cdestg = cg; @@ -1321,14 +1320,13 @@ void R_CreateColormap2(char *p1, char *p2, char *p3) cg = ((HEX2INT(p1[3]) * 16) + HEX2INT(p1[4])); cb = ((HEX2INT(p1[5]) * 16) + HEX2INT(p1[6])); - // i don't know why this doesn't work... - /*if (encoremap) + if (encoremap) { - i = NearestColor(cr, cg, cb); - cr = pLocalPalette[encoremap[i]].s.red; - cg = pLocalPalette[encoremap[i]].s.green; - cb = pLocalPalette[encoremap[i]].s.blue; - }*/ + i = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; + cr = pLocalPalette[i].s.red; + cg = pLocalPalette[i].s.green; + cb = pLocalPalette[i].s.blue; + } cmaskr = cr; cmaskg = cg; @@ -1378,14 +1376,13 @@ void R_CreateColormap2(char *p1, char *p2, char *p3) cg = ((HEX2INT(p3[3]) * 16) + HEX2INT(p3[4])); cb = ((HEX2INT(p3[5]) * 16) + HEX2INT(p3[6])); - // i don't know why this doesn't work... - /*if (encoremap) + if (encoremap) { - i = NearestColor(cr, cg, cb); - cr = pLocalPalette[encoremap[i]].s.red; - cg = pLocalPalette[encoremap[i]].s.green; - cb = pLocalPalette[encoremap[i]].s.blue; - }*/ + i = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; + cr = pLocalPalette[i].s.red; + cg = pLocalPalette[i].s.green; + cb = pLocalPalette[i].s.blue; + } cdestr = cr; cdestg = cg; diff --git a/src/sounds.c b/src/sounds.c index 3b41dfa1..984f5a57 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -809,6 +809,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"yeeeah", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"noooo1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"noooo2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"ruby1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"ruby2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"hogbom", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // SRB2kart - Skin sounds diff --git a/src/sounds.h b/src/sounds.h index 0f8d5a3b..210feba7 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -881,6 +881,8 @@ typedef enum sfx_yeeeah, sfx_noooo1, sfx_noooo2, + sfx_ruby1, + sfx_ruby2, sfx_hogbom, sfx_kwin,