Add Music_BatchExempt, temporarily exemplify a tune from batch operations

This commit is contained in:
James R 2023-12-05 04:15:21 -08:00
parent be8d8178bb
commit 806067f48f
4 changed files with 21 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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.

View file

@ -73,6 +73,12 @@ public:
{
for (auto& [_, tune] : map_)
{
if (tune.resist_once)
{
tune.resist_once = false;
continue;
}
if (!tune.resist)
{
f(tune);

View file

@ -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).