diff --git a/src/k_kart.c b/src/k_kart.c index 99f2b1cac..bf63ad04e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -81,11 +81,9 @@ void K_TimerInit(void) rainbowstartavailable = false; } - if (numPlayers <= 2) - { - introtime = 0; // No intro in Record Attack / 1v1 - } - else + // No intro in Record Attack / 1v1 + // Leave unset for the value in K_TimerReset + if (numPlayers > 2) { introtime = (108) + 5; // 108 for rotation, + 5 for white fade } @@ -9675,11 +9673,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground) { if ((leveltime == starttime-(3*TICRATE)) || (leveltime == starttime-(2*TICRATE)) || (leveltime == starttime-TICRATE)) S_StartSound(NULL, sfx_s3ka7); - if (leveltime == starttime) - { + + if (leveltime == starttime-(3*TICRATE)) + S_FadeOutStopMusic(3500); + else if (leveltime == starttime) S_StartSound(NULL, sfx_s3kad); - S_StopMusic(); // The GO! sound stops the level start ambience - } } } diff --git a/src/p_tick.c b/src/p_tick.c index 69641d6be..22a090fba 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -617,6 +617,19 @@ void P_Ticker(boolean run) S_ShowMusicCredit(); } + if (encoremode) + { + // Encore humming starts immediately. + if (leveltime == 3) + S_ChangeMusicInternal("encore", true); + } + else + { + // Plays the POSITION music after the camera spin + if (leveltime == introtime) + S_ChangeMusicInternal("postn", true); + } + ps_lua_thinkframe_time = I_GetPreciseTime(); LUAh_ThinkFrame(); ps_lua_thinkframe_time = I_GetPreciseTime() - ps_lua_thinkframe_time; diff --git a/src/p_user.c b/src/p_user.c index 1e1269751..3b7382392 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -804,9 +804,7 @@ void P_RestoreMusic(player_t *player) return; // Event - Level Start - if (leveltime < (starttime + (TICRATE/2))) - S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); //S_StopMusic(); - else // see also where time overs are handled - search for "lives = 2" in this file + if (leveltime >= (starttime + (TICRATE/2))) // see also where time overs are handled - search for "lives = 2" in this file { INT32 wantedmus = 0; // 0 is level music, 1 is invincibility, 2 is grow diff --git a/src/s_sound.c b/src/s_sound.c index ac66a5777..4a224ec6f 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2351,7 +2351,7 @@ void S_StartEx(boolean reset) S_StopMusic(); // Starting ambience should always be restarted, if playing. if (leveltime < (starttime + (TICRATE/2))) // SRB2Kart - S_ChangeMusicEx((encoremode ? "estart" : "kstart"), 0, false, mapmusposition, 0, 0); + S_StartSound(NULL, encoremode ? sfx_ruby2 : sfx_kstart); else S_ChangeMusicEx(mapmusname, mapmusflags, true, mapmusposition, 0, 0); diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 4a135c136..d50bb49b5 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -1227,7 +1227,7 @@ boolean I_LoadSong(char *data, size_t len) else if (!strncmp(p, key3, key3len)) // is it LOOPMS=? { p += key3len; // skip MS= - loop_point = (float)(atoi(p) / 1000.0L); // LOOPMS works by real time, as miliseconds. + loop_point = atof(p) / 1000.f; // LOOPMS works by real time, as miliseconds. // Everything that uses LOOPMS will work perfectly with SDL_Mixer. } } diff --git a/src/sounds.c b/src/sounds.c index e9a13da77..58e8f2afe 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1099,6 +1099,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"dbgsal", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Debug notification {"cock", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Hammer cocks, bang bang {"itcaps", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, "Item capsule"}, + {"kstart", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Sonic Adventure shwing! // SRB2Kart - Engine sounds // Engine class A diff --git a/src/sounds.h b/src/sounds.h index 9abf99117..4093fec7b 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1163,6 +1163,7 @@ typedef enum sfx_dbgsal, sfx_cock, sfx_itcaps, + sfx_kstart, // Next up: UNIQUE ENGINE SOUNDS! Hoooooo boy... // Engine class A - Low Speed, Low Weight