diff --git a/src/music.cpp b/src/music.cpp index 6da57fca3..b8b79065c 100644 --- a/src/music.cpp +++ b/src/music.cpp @@ -353,3 +353,13 @@ const char* Music_CurrentId(void) { return g_tunes.current_id(); } + +void Music_BatchExempt(const char* id) +{ + Tune* tune = g_tunes.find(id); + + if (tune) + { + tune->resist_once = true; + } +} diff --git a/src/music.h b/src/music.h index c7712a472..a85b1913f 100644 --- a/src/music.h +++ b/src/music.h @@ -92,6 +92,10 @@ void Music_Remap(const char *id, const char *song); // Set whether a tune should loop. void Music_Loop(const char *id, boolean loop); +// Temporarily exemplify a tune from batch operations, such +// as Music_StopAll. +void Music_BatchExempt(const char *id); + // // Query properties. diff --git a/src/music_manager.hpp b/src/music_manager.hpp index 90924c75e..38110d46c 100644 --- a/src/music_manager.hpp +++ b/src/music_manager.hpp @@ -73,6 +73,12 @@ public: { for (auto& [_, tune] : map_) { + if (tune.resist_once) + { + tune.resist_once = false; + continue; + } + if (!tune.resist) { f(tune); diff --git a/src/music_tune.hpp b/src/music_tune.hpp index b22efb23d..ec9aac6dd 100644 --- a/src/music_tune.hpp +++ b/src/music_tune.hpp @@ -57,6 +57,7 @@ public: // from TuneManager::stop_all etc. It must be // stopped/paused individually. bool resist = false; + bool resist_once = false; // set at runtime // This tune shows a credit when first played (not // resumed).