mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Add level_nosync tune, played if GTR_NOPOSITION
- Does not reset if level music does not change between levels
This commit is contained in:
parent
95a0fcabd5
commit
be8d8178bb
3 changed files with 31 additions and 4 deletions
|
|
@ -35,6 +35,13 @@ void Music_Init(void)
|
||||||
tune.nightcoreable = true;
|
tune.nightcoreable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Tune& tune = g_tunes.insert("level_nosync", g_tunes.find("level"));
|
||||||
|
|
||||||
|
tune.sync = false;
|
||||||
|
tune.resist = true;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
Tune& tune = g_tunes.insert("position");
|
Tune& tune = g_tunes.insert("position");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8110,11 +8110,27 @@ void P_ResetLevelMusic(void)
|
||||||
|
|
||||||
void P_LoadLevelMusic(void)
|
void P_LoadLevelMusic(void)
|
||||||
{
|
{
|
||||||
tic_t level_music_start = starttime + (TICRATE/2);
|
const char *music = mapheaderinfo[gamemap-1]->musname[mapmusrng];
|
||||||
|
|
||||||
Music_StopAll();
|
Music_StopAll();
|
||||||
Music_Remap("level", mapheaderinfo[gamemap-1]->musname[mapmusrng]);
|
|
||||||
Music_Seek("level", max(leveltime, level_music_start) - level_music_start);
|
if (gametyperules & GTR_NOPOSITION)
|
||||||
|
{
|
||||||
|
if (stricmp(Music_Song("level_nosync"), music))
|
||||||
|
{
|
||||||
|
Music_Stop("level_nosync"); // reset when music changes
|
||||||
|
}
|
||||||
|
Music_Remap("level_nosync", music);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Music_Stop("level_nosync");
|
||||||
|
Music_Remap("level_nosync", ""); // signal that this should not play
|
||||||
|
Music_Remap("level", music);
|
||||||
|
|
||||||
|
tic_t level_music_start = starttime + (TICRATE/2);
|
||||||
|
Music_Seek("level", max(leveltime, level_music_start) - level_music_start);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Loads a level from a lump or external wad.
|
/** Loads a level from a lump or external wad.
|
||||||
|
|
|
||||||
|
|
@ -975,7 +975,11 @@ void P_Ticker(boolean run)
|
||||||
if (leveltime == (starttime + (TICRATE/2)))
|
if (leveltime == (starttime + (TICRATE/2)))
|
||||||
{
|
{
|
||||||
// Plays the music after the starting countdown.
|
// Plays the music after the starting countdown.
|
||||||
Music_Play("level");
|
if (!Music_Playing("level_nosync"))
|
||||||
|
{
|
||||||
|
// Do not stop level_nosync
|
||||||
|
Music_Play(Music_Song("level_nosync")[0] ? "level_nosync" : "level");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (starttime != introtime)
|
else if (starttime != introtime)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue