From 37e79ebfbdb9053dc11464790e50230e827d4041 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 10 Jan 2019 01:03:53 -0500 Subject: [PATCH] Redone credits for joiners in a less stupid way, + redone start ambience in a less stupid way --- src/g_game.c | 4 ++++ src/k_kart.c | 2 +- src/p_setup.c | 4 ---- src/s_sound.c | 12 ++++++++---- src/s_sound.h | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index fa7f6ce1..1e0c7e46 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2362,6 +2362,7 @@ void G_PlayerReborn(INT32 player) INT32 bumper; INT32 comebackpoints; INT32 wanted; + boolean songcredit = false; score = players[player].score; marescore = players[player].marescore; @@ -2540,10 +2541,13 @@ void G_PlayerReborn(INT32 player) strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7); mapmusname[6] = 0; mapmusflags = mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK; + songcredit = true; } } P_RestoreMusic(p); + if (songcredit) + S_ShowMusicCredit(); if (leveltime > (starttime + (TICRATE/2)) && !p->spectator) p->kartstuff[k_respawn] = 48; // Respawn effect diff --git a/src/k_kart.c b/src/k_kart.c index 50d19c19..320105ef 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4445,7 +4445,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) // Plays the music after the starting countdown. if (P_IsLocalPlayer(player) && leveltime == (starttime + (TICRATE/2))) { - S_ChangeMusicInternal(mapmusname, true); + S_ChangeMusic(mapmusname, mapmusflags, true); S_ShowMusicCredit(); } } diff --git a/src/p_setup.c b/src/p_setup.c index 90ac3a7c..49b22184 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2869,10 +2869,6 @@ boolean P_SetupLevel(boolean skipprecip) // 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((encoremode ? "estart" : "kstart"), false); //S_StopMusic(); levelfadecol = (encoremode && !ranspecialwipe ? 122 : 120); diff --git a/src/s_sound.c b/src/s_sound.c index cc17ccd0..856aa045 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -101,7 +101,7 @@ consvar_t cv_numChannels = {"snd_channels", "64", CV_SAVE|CV_CALL, CV_Unsigned, #endif consvar_t surround = {"surround", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_resetmusic = {"resetmusic", "No", CV_SAVE|CV_NOSHOWHELP, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; +//consvar_t cv_resetmusic = {"resetmusic", "No", CV_SAVE|CV_NOSHOWHELP, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; // Sound system toggles, saved into the config consvar_t cv_gamedigimusic = {"digimusic", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameDigiMusic_OnChange, 0, NULL, NULL, 0, 0, NULL}; @@ -263,7 +263,7 @@ void S_RegisterSoundStuff(void) #endif CV_RegisterVar(&surround); CV_RegisterVar(&cv_samplerate); - CV_RegisterVar(&cv_resetmusic); + //CV_RegisterVar(&cv_resetmusic); CV_RegisterVar(&cv_gamesounds); CV_RegisterVar(&cv_gamedigimusic); #ifndef NO_MIDI @@ -2043,9 +2043,13 @@ void S_Start(void) mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK); } - if (cv_resetmusic.value) + //if (cv_resetmusic.value) // Starting ambience should always be restarted S_StopMusic(); - S_ChangeMusic(mapmusname, mapmusflags, true); + + if (leveltime < (starttime + (TICRATE/2))) // SRB2Kart + S_ChangeMusic((encoremode ? "estart" : "kstart"), 0, false); + else + S_ChangeMusic(mapmusname, mapmusflags, true); } static void Command_Tunes_f(void) diff --git a/src/s_sound.h b/src/s_sound.h index df90ecb1..1ad519c2 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -27,7 +27,7 @@ extern consvar_t stereoreverse; extern consvar_t cv_soundvolume, cv_digmusicvolume;//, cv_midimusicvolume; extern consvar_t cv_numChannels; extern consvar_t surround; -extern consvar_t cv_resetmusic; +//extern consvar_t cv_resetmusic; extern consvar_t cv_gamedigimusic; #ifndef NO_MIDI extern consvar_t cv_gamemidimusic;