mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-13 06:13:18 +00:00
nodigimusic nomusic nosound -> digital_disabled midi_disabled sound_disabled
This commit is contained in:
parent
d5ec388159
commit
07738fb0bc
5 changed files with 48 additions and 85 deletions
23
src/d_main.c
23
src/d_main.c
|
@ -112,13 +112,10 @@ INT32 postimgparam;
|
|||
postimg_t postimgtype2 = postimg_none;
|
||||
INT32 postimgparam2;
|
||||
|
||||
boolean nomidimusic = false, nosound = false;
|
||||
boolean nodigimusic = false; // No fmod-based music
|
||||
|
||||
// These variables are only true if
|
||||
// the respective sound system is initialized
|
||||
// and active, but no sounds/music should play.
|
||||
boolean music_disabled = false;
|
||||
// These variables are in effect
|
||||
// whether the respective sound system is disabled
|
||||
// or they're init'ed, but the player just toggled them
|
||||
boolean midi_disabled = false;
|
||||
boolean sound_disabled = false;
|
||||
boolean digital_disabled = false;
|
||||
|
||||
|
@ -1192,23 +1189,23 @@ void D_SRB2Main(void)
|
|||
// setting up sound
|
||||
if (dedicated)
|
||||
{
|
||||
nosound = true;
|
||||
nomidimusic = nodigimusic = true;
|
||||
sound_disabled = true;
|
||||
midi_disabled = digital_disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Printf("S_InitSfxChannels(): Setting up sound channels.\n");
|
||||
}
|
||||
if (M_CheckParm("-nosound"))
|
||||
nosound = true;
|
||||
sound_disabled = true;
|
||||
if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic
|
||||
nomidimusic = nodigimusic = true;
|
||||
midi_disabled = digital_disabled = true;
|
||||
else
|
||||
{
|
||||
if (M_CheckParm("-nomidimusic"))
|
||||
nomidimusic = true; ; // WARNING: DOS version initmusic in I_StartupSound
|
||||
midi_disabled = true; ; // WARNING: DOS version initmusic in I_StartupSound
|
||||
if (M_CheckParm("-nodigmusic"))
|
||||
nodigimusic = true; // WARNING: DOS version initmusic in I_StartupSound
|
||||
digital_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
|
||||
}
|
||||
I_StartupSound();
|
||||
I_InitMusic();
|
||||
|
|
|
@ -90,10 +90,7 @@ extern boolean fromlevelselect;
|
|||
// Internal parameters for sound rendering.
|
||||
// ========================================
|
||||
|
||||
extern boolean nomidimusic; // defined in d_main.c
|
||||
extern boolean nosound;
|
||||
extern boolean nodigimusic;
|
||||
extern boolean music_disabled;
|
||||
extern boolean midi_disabled;
|
||||
extern boolean sound_disabled;
|
||||
extern boolean digital_disabled;
|
||||
|
||||
|
|
76
src/m_menu.c
76
src/m_menu.c
|
@ -9350,7 +9350,7 @@ static void M_SoundMenu(INT32 choice)
|
|||
{
|
||||
(void)choice;
|
||||
|
||||
OP_SoundOptionsMenu[6].status = ((nosound || sound_disabled) ? IT_GRAYEDOUT : (IT_STRING | IT_CVAR));
|
||||
OP_SoundOptionsMenu[6].status = (sound_disabled ? IT_GRAYEDOUT : (IT_STRING | IT_CVAR));
|
||||
M_SetupNextMenu(&OP_SoundOptionsDef);
|
||||
}
|
||||
|
||||
|
@ -9363,25 +9363,25 @@ void M_DrawSoundMenu(void)
|
|||
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x,
|
||||
currentMenu->y+currentMenu->menuitems[0].alphaKey,
|
||||
(nosound ? V_REDMAP : V_YELLOWMAP),
|
||||
((nosound || sound_disabled) ? offstring : onstring));
|
||||
(sound_disabled ? V_REDMAP : V_YELLOWMAP),
|
||||
(sound_disabled ? offstring : onstring));
|
||||
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x,
|
||||
currentMenu->y+currentMenu->menuitems[2].alphaKey,
|
||||
(nodigimusic ? V_REDMAP : V_YELLOWMAP),
|
||||
((nodigimusic || digital_disabled) ? offstring : onstring));
|
||||
(digital_disabled ? V_REDMAP : V_YELLOWMAP),
|
||||
(digital_disabled ? offstring : onstring));
|
||||
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x,
|
||||
currentMenu->y+currentMenu->menuitems[4].alphaKey,
|
||||
(nomidimusic ? V_REDMAP : V_YELLOWMAP),
|
||||
((nomidimusic || music_disabled) ? offstring : onstring));
|
||||
(midi_disabled ? V_REDMAP : V_YELLOWMAP),
|
||||
(midi_disabled ? offstring : onstring));
|
||||
|
||||
if (itemOn == 0)
|
||||
lengthstring = ((nosound || sound_disabled) ? 3 : 2);
|
||||
lengthstring = (sound_disabled ? 3 : 2);
|
||||
else if (itemOn == 2)
|
||||
lengthstring = ((nodigimusic || digital_disabled) ? 3 : 2);
|
||||
lengthstring = (digital_disabled ? 3 : 2);
|
||||
else if (itemOn == 4)
|
||||
lengthstring = ((nomidimusic || music_disabled) ? 3 : 2);
|
||||
lengthstring = (midi_disabled ? 3 : 2);
|
||||
else
|
||||
return;
|
||||
|
||||
|
@ -9416,11 +9416,11 @@ static void M_ToggleSFX(INT32 choice)
|
|||
break;
|
||||
}
|
||||
|
||||
if (nosound)
|
||||
if (sound_disabled)
|
||||
{
|
||||
nosound = false;
|
||||
sound_disabled = false;
|
||||
I_StartupSound();
|
||||
if (nosound) return;
|
||||
if (sound_disabled) return;
|
||||
S_InitSfxChannels(cv_soundvolume.value);
|
||||
S_StartSound(NULL, sfx_strpst);
|
||||
OP_SoundOptionsMenu[6].status = IT_STRING | IT_CVAR;
|
||||
|
@ -9469,12 +9469,11 @@ static void M_ToggleDigital(INT32 choice)
|
|||
break;
|
||||
}
|
||||
|
||||
if (nodigimusic)
|
||||
if (digital_disabled)
|
||||
{
|
||||
nodigimusic = false;
|
||||
digital_disabled = false;
|
||||
I_InitMusic();
|
||||
if (nodigimusic) return;
|
||||
S_InitSfxChannels(cv_soundvolume.value);
|
||||
if (digital_disabled) return;
|
||||
S_StopMusic();
|
||||
if (Playing())
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
|
@ -9484,21 +9483,9 @@ static void M_ToggleDigital(INT32 choice)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (digital_disabled)
|
||||
{
|
||||
digital_disabled = false;
|
||||
if (Playing())
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
else
|
||||
S_ChangeMusicInternal("_clear", false);
|
||||
//M_StartMessage(M_GetText("Digital Music Enabled\n"), NULL, MM_NOTHING);
|
||||
}
|
||||
else
|
||||
{
|
||||
digital_disabled = true;
|
||||
S_StopMusic();
|
||||
//M_StartMessage(M_GetText("Digital Music Disabled\n"), NULL, MM_NOTHING);
|
||||
}
|
||||
digital_disabled = true;
|
||||
S_StopMusic();
|
||||
//M_StartMessage(M_GetText("Digital Music Disabled\n"), NULL, MM_NOTHING);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9526,12 +9513,11 @@ static void M_ToggleMIDI(INT32 choice)
|
|||
break;
|
||||
}
|
||||
|
||||
if (nomidimusic)
|
||||
if (midi_disabled)
|
||||
{
|
||||
nomidimusic = false;
|
||||
midi_disabled = false;
|
||||
I_InitMusic();
|
||||
if (nomidimusic) return;
|
||||
S_InitSfxChannels(cv_soundvolume.value);
|
||||
if (midi_disabled) return;
|
||||
if (Playing())
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
else
|
||||
|
@ -9540,21 +9526,9 @@ static void M_ToggleMIDI(INT32 choice)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (music_disabled)
|
||||
{
|
||||
music_disabled = false;
|
||||
if (Playing())
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
else
|
||||
S_ChangeMusicInternal("_clear", false);
|
||||
//M_StartMessage(M_GetText("MIDI Music Enabled\n"), NULL, MM_NOTHING);
|
||||
}
|
||||
else
|
||||
{
|
||||
music_disabled = true;
|
||||
S_StopMusic();
|
||||
//M_StartMessage(M_GetText("MIDI Music Disabled\n"), NULL, MM_NOTHING);
|
||||
}
|
||||
midi_disabled = true;
|
||||
S_StopMusic();
|
||||
//M_StartMessage(M_GetText("MIDI Music Disabled\n"), NULL, MM_NOTHING);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9172,7 +9172,7 @@ void P_PrecipitationEffects(void)
|
|||
if (!playeringame[displayplayer] || !players[displayplayer].mo)
|
||||
return;
|
||||
|
||||
if (nosound || sound_disabled)
|
||||
if (sound_disabled)
|
||||
return; // Sound off? D'aw, no fun.
|
||||
|
||||
if (players[displayplayer].mo->subsector->sector->ceilingpic == skyflatnum)
|
||||
|
|
|
@ -230,7 +230,7 @@ void S_RegisterSoundStuff(void)
|
|||
{
|
||||
if (dedicated)
|
||||
{
|
||||
nosound = true;
|
||||
sound_disabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -494,7 +494,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
|
|||
mobj_t *listenmobj = players[displayplayer].mo;
|
||||
mobj_t *listenmobj2 = NULL;
|
||||
|
||||
if (sound_disabled || !sound_started || nosound)
|
||||
if (sound_disabled || !sound_started)
|
||||
return;
|
||||
|
||||
// Don't want a sound? Okay then...
|
||||
|
@ -824,7 +824,7 @@ void S_UpdateSounds(void)
|
|||
goto notinlevel;
|
||||
}
|
||||
|
||||
if (dedicated || nosound)
|
||||
if (dedicated || sound_disabled)
|
||||
return;
|
||||
|
||||
if (players[displayplayer].awayviewtics)
|
||||
|
@ -1307,7 +1307,7 @@ void S_InitSfxChannels(INT32 sfxVolume)
|
|||
}
|
||||
|
||||
// precache sounds if requested by cmdline, or precachesound var true
|
||||
if (!nosound && (M_CheckParm("-precachesound") || precachesound.value))
|
||||
if (!sound_disabled && (M_CheckParm("-precachesound") || precachesound.value))
|
||||
{
|
||||
// Initialize external data (all sounds) at start, keep static.
|
||||
CONS_Printf(M_GetText("Loading sounds... "));
|
||||
|
@ -1352,24 +1352,19 @@ static char music_name[7]; // up to 6-character name
|
|||
/// Music Status
|
||||
/// ------------------------
|
||||
|
||||
boolean S_DigMusicDisabled()
|
||||
boolean S_DigMusicDisabled(void)
|
||||
{
|
||||
return (nodigimusic || digital_disabled);
|
||||
return digital_disabled;
|
||||
}
|
||||
|
||||
boolean S_MIDIMusicDisabled()
|
||||
boolean S_MIDIMusicDisabled(void)
|
||||
{
|
||||
return (nomidimusic || music_disabled);
|
||||
return midi_disabled;
|
||||
}
|
||||
|
||||
boolean S_MusicDisabled()
|
||||
boolean S_MusicDisabled(void)
|
||||
{
|
||||
return (
|
||||
(nodigimusic && nomidimusic) ||
|
||||
(music_disabled && digital_disabled) ||
|
||||
(nodigimusic && music_disabled) ||
|
||||
(nomidimusic && digital_disabled)
|
||||
);
|
||||
return (midi_disabled && digital_disabled);
|
||||
}
|
||||
|
||||
boolean S_MusicPlaying(void)
|
||||
|
@ -1453,7 +1448,7 @@ static void S_UnloadMusic(void)
|
|||
|
||||
static boolean S_PlayMusic(boolean looping)
|
||||
{
|
||||
if (nodigimusic || digital_disabled)
|
||||
if (S_DigMusicDisabled())
|
||||
return false; // try midi
|
||||
|
||||
if (!I_PlaySong(looping))
|
||||
|
|
Loading…
Reference in a new issue