musicdef_t: Add an important parameter

If set to true/yes/1, add at the head of the sequence in S_PopulateSoundTestSequence.
Otherwise, append to the tail.
This commit is contained in:
toaster 2023-04-03 22:10:37 +01:00
parent 5dd4e36b72
commit dc8a97475f
2 changed files with 22 additions and 1 deletions

View file

@ -1481,7 +1481,8 @@ void S_PopulateSoundTestSequence(void)
S_InsertMapIntoSoundTestSequence(i, &tail);
}
// Finally, we insert all other musicdefstart at the head.
// Finally, we insert all important musicdefs at the head,
// and all others at the tail.
// It's being added to the sequence in reverse order...
// but because musicdefstart is ALSO populated in reverse,
// the reverse of the reverse is the right way around!
@ -1493,12 +1494,27 @@ void S_PopulateSoundTestSequence(void)
if (def->sequence.id == soundtest.sequence.id)
continue;
if (def->important == false)
continue;
def->sequence.id = soundtest.sequence.id;
def->sequence.map = NEXTMAP_INVALID;
def->sequence.next = soundtest.sequence.next;
soundtest.sequence.next = def;
}
for (def = musicdefstart; def; def = def->next)
{
if (def->sequence.id == soundtest.sequence.id)
continue;
def->sequence.id = soundtest.sequence.id;
def->sequence.map = NEXTMAP_INVALID;
def->sequence.next = *tail;
*tail = def;
}
}
}
@ -1961,6 +1977,10 @@ ReadMusicDefFields
{
def->volume = atoi(textline);
}
else if (!stricmp(stoken, "important"))
{
def->important = (textline[0] == 'Y' || textline[0] == 'T' || textline[0] == '1');
}
else
{
MusicDefError(CONS_WARNING,

View file

@ -196,6 +196,7 @@ struct musicdef_t
char *composers;
int volume;
int debug_volume;
boolean important;
musicdef_t *next;
soundtestsequence_t sequence;
};