Merge branch 'no-audio-option' into 'master'

`-noaudio` option to cover `-nomusic` and `-nosound`

See merge request KartKrew/Kart-Public!129
This commit is contained in:
wolfs 2019-04-26 06:37:02 -04:00
commit 4dff8b4a11
2 changed files with 21 additions and 10 deletions

View file

@ -1390,10 +1390,9 @@ void D_SRB2Main(void)
midi_disabled = true; midi_disabled = true;
#endif #endif
} }
if (M_CheckParm("-nosound")) if (M_CheckParm("-noaudio")) // combines -nosound and -nomusic
sound_disabled = true;
if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic
{ {
sound_disabled = true;
digital_disabled = true; digital_disabled = true;
#ifndef NO_MIDI #ifndef NO_MIDI
midi_disabled = true; midi_disabled = true;
@ -1401,12 +1400,24 @@ void D_SRB2Main(void)
} }
else else
{ {
if (M_CheckParm("-nosound"))
sound_disabled = true;
if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic
{
digital_disabled = true;
#ifndef NO_MIDI #ifndef NO_MIDI
if (M_CheckParm("-nomidimusic")) midi_disabled = true;
midi_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
#endif #endif
if (M_CheckParm("-nodigmusic")) }
digital_disabled = true; // WARNING: DOS version initmusic in I_StartupSound else
{
#ifndef NO_MIDI
if (M_CheckParm("-nomidimusic"))
midi_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
#endif
if (M_CheckParm("-nodigmusic"))
digital_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
}
} }
if (!( sound_disabled && digital_disabled if (!( sound_disabled && digital_disabled
#ifndef NO_MIDI #ifndef NO_MIDI

View file

@ -2182,7 +2182,7 @@ static void Command_RestartAudio_f(void)
void GameSounds_OnChange(void) void GameSounds_OnChange(void)
{ {
if (M_CheckParm("-nosound")) if (M_CheckParm("-nosound") || M_CheckParm("-noaudio"))
return; return;
if (sound_disabled) if (sound_disabled)
@ -2196,7 +2196,7 @@ void GameSounds_OnChange(void)
void GameDigiMusic_OnChange(void) void GameDigiMusic_OnChange(void)
{ {
if (M_CheckParm("-nomusic")) if (M_CheckParm("-nomusic") || M_CheckParm("-noaudio"))
return; return;
else if (M_CheckParm("-nodigmusic")) else if (M_CheckParm("-nodigmusic"))
return; return;
@ -2239,7 +2239,7 @@ void GameDigiMusic_OnChange(void)
#ifndef NO_MIDI #ifndef NO_MIDI
void GameMIDIMusic_OnChange(void) void GameMIDIMusic_OnChange(void)
{ {
if (M_CheckParm("-nomusic")) if (M_CheckParm("-nomusic") || M_CheckParm("-noaudio"))
return; return;
else if (M_CheckParm("-nomidimusic")) else if (M_CheckParm("-nomidimusic"))
return; return;