mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
TuneManager: clear current song if music is disabled, so music can resume later
This commit is contained in:
parent
7744a2823e
commit
2d450b05f8
4 changed files with 13 additions and 0 deletions
|
|
@ -183,6 +183,11 @@ void Music_Tick(void)
|
|||
g_tunes.tick();
|
||||
}
|
||||
|
||||
void Music_Flip(void)
|
||||
{
|
||||
g_tunes.flip();
|
||||
}
|
||||
|
||||
void Music_Play(const char* id)
|
||||
{
|
||||
Tune* tune = g_tunes.find(id);
|
||||
|
|
|
|||
|
|
@ -144,6 +144,11 @@ void Music_Init(void);
|
|||
// Call this every tic to update the music.
|
||||
void Music_Tick(void);
|
||||
|
||||
// Flips the internal state so music is reloaded next tick.
|
||||
// This is required when disabling music during runtime so
|
||||
// the music plays again when re-enabled.
|
||||
void Music_Flip(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ public:
|
|||
return res.first->second;
|
||||
}
|
||||
|
||||
void flip() { current_song_ = {}; }
|
||||
|
||||
void tick();
|
||||
void pause_unpause() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -2515,6 +2515,7 @@ void GameDigiMusic_OnChange(void)
|
|||
{
|
||||
digital_disabled = true;
|
||||
I_UnloadSong();
|
||||
Music_Flip();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue