diff --git a/src/s_sound.c b/src/s_sound.c index 79f8cf04d..7fd71db5e 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -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, diff --git a/src/s_sound.h b/src/s_sound.h index 5c0c73a02..48a5c571c 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -196,6 +196,7 @@ struct musicdef_t char *composers; int volume; int debug_volume; + boolean important; musicdef_t *next; soundtestsequence_t sequence; };