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;
|
postimg_t postimgtype2 = postimg_none;
|
||||||
INT32 postimgparam2;
|
INT32 postimgparam2;
|
||||||
|
|
||||||
boolean nomidimusic = false, nosound = false;
|
// These variables are in effect
|
||||||
boolean nodigimusic = false; // No fmod-based music
|
// whether the respective sound system is disabled
|
||||||
|
// or they're init'ed, but the player just toggled them
|
||||||
// These variables are only true if
|
boolean midi_disabled = false;
|
||||||
// the respective sound system is initialized
|
|
||||||
// and active, but no sounds/music should play.
|
|
||||||
boolean music_disabled = false;
|
|
||||||
boolean sound_disabled = false;
|
boolean sound_disabled = false;
|
||||||
boolean digital_disabled = false;
|
boolean digital_disabled = false;
|
||||||
|
|
||||||
|
@ -1192,23 +1189,23 @@ void D_SRB2Main(void)
|
||||||
// setting up sound
|
// setting up sound
|
||||||
if (dedicated)
|
if (dedicated)
|
||||||
{
|
{
|
||||||
nosound = true;
|
sound_disabled = true;
|
||||||
nomidimusic = nodigimusic = true;
|
midi_disabled = digital_disabled = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CONS_Printf("S_InitSfxChannels(): Setting up sound channels.\n");
|
CONS_Printf("S_InitSfxChannels(): Setting up sound channels.\n");
|
||||||
}
|
}
|
||||||
if (M_CheckParm("-nosound"))
|
if (M_CheckParm("-nosound"))
|
||||||
nosound = true;
|
sound_disabled = true;
|
||||||
if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic
|
if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic
|
||||||
nomidimusic = nodigimusic = true;
|
midi_disabled = digital_disabled = true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (M_CheckParm("-nomidimusic"))
|
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"))
|
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_StartupSound();
|
||||||
I_InitMusic();
|
I_InitMusic();
|
||||||
|
|
|
@ -90,10 +90,7 @@ extern boolean fromlevelselect;
|
||||||
// Internal parameters for sound rendering.
|
// Internal parameters for sound rendering.
|
||||||
// ========================================
|
// ========================================
|
||||||
|
|
||||||
extern boolean nomidimusic; // defined in d_main.c
|
extern boolean midi_disabled;
|
||||||
extern boolean nosound;
|
|
||||||
extern boolean nodigimusic;
|
|
||||||
extern boolean music_disabled;
|
|
||||||
extern boolean sound_disabled;
|
extern boolean sound_disabled;
|
||||||
extern boolean digital_disabled;
|
extern boolean digital_disabled;
|
||||||
|
|
||||||
|
|
66
src/m_menu.c
66
src/m_menu.c
|
@ -9350,7 +9350,7 @@ static void M_SoundMenu(INT32 choice)
|
||||||
{
|
{
|
||||||
(void)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);
|
M_SetupNextMenu(&OP_SoundOptionsDef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9363,25 +9363,25 @@ void M_DrawSoundMenu(void)
|
||||||
|
|
||||||
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x,
|
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x,
|
||||||
currentMenu->y+currentMenu->menuitems[0].alphaKey,
|
currentMenu->y+currentMenu->menuitems[0].alphaKey,
|
||||||
(nosound ? V_REDMAP : V_YELLOWMAP),
|
(sound_disabled ? V_REDMAP : V_YELLOWMAP),
|
||||||
((nosound || sound_disabled) ? offstring : onstring));
|
(sound_disabled ? offstring : onstring));
|
||||||
|
|
||||||
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x,
|
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x,
|
||||||
currentMenu->y+currentMenu->menuitems[2].alphaKey,
|
currentMenu->y+currentMenu->menuitems[2].alphaKey,
|
||||||
(nodigimusic ? V_REDMAP : V_YELLOWMAP),
|
(digital_disabled ? V_REDMAP : V_YELLOWMAP),
|
||||||
((nodigimusic || digital_disabled) ? offstring : onstring));
|
(digital_disabled ? offstring : onstring));
|
||||||
|
|
||||||
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x,
|
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x,
|
||||||
currentMenu->y+currentMenu->menuitems[4].alphaKey,
|
currentMenu->y+currentMenu->menuitems[4].alphaKey,
|
||||||
(nomidimusic ? V_REDMAP : V_YELLOWMAP),
|
(midi_disabled ? V_REDMAP : V_YELLOWMAP),
|
||||||
((nomidimusic || music_disabled) ? offstring : onstring));
|
(midi_disabled ? offstring : onstring));
|
||||||
|
|
||||||
if (itemOn == 0)
|
if (itemOn == 0)
|
||||||
lengthstring = ((nosound || sound_disabled) ? 3 : 2);
|
lengthstring = (sound_disabled ? 3 : 2);
|
||||||
else if (itemOn == 2)
|
else if (itemOn == 2)
|
||||||
lengthstring = ((nodigimusic || digital_disabled) ? 3 : 2);
|
lengthstring = (digital_disabled ? 3 : 2);
|
||||||
else if (itemOn == 4)
|
else if (itemOn == 4)
|
||||||
lengthstring = ((nomidimusic || music_disabled) ? 3 : 2);
|
lengthstring = (midi_disabled ? 3 : 2);
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -9416,11 +9416,11 @@ static void M_ToggleSFX(INT32 choice)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nosound)
|
if (sound_disabled)
|
||||||
{
|
{
|
||||||
nosound = false;
|
sound_disabled = false;
|
||||||
I_StartupSound();
|
I_StartupSound();
|
||||||
if (nosound) return;
|
if (sound_disabled) return;
|
||||||
S_InitSfxChannels(cv_soundvolume.value);
|
S_InitSfxChannels(cv_soundvolume.value);
|
||||||
S_StartSound(NULL, sfx_strpst);
|
S_StartSound(NULL, sfx_strpst);
|
||||||
OP_SoundOptionsMenu[6].status = IT_STRING | IT_CVAR;
|
OP_SoundOptionsMenu[6].status = IT_STRING | IT_CVAR;
|
||||||
|
@ -9469,24 +9469,12 @@ static void M_ToggleDigital(INT32 choice)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodigimusic)
|
|
||||||
{
|
|
||||||
nodigimusic = false;
|
|
||||||
I_InitMusic();
|
|
||||||
if (nodigimusic) return;
|
|
||||||
S_InitSfxChannels(cv_soundvolume.value);
|
|
||||||
S_StopMusic();
|
|
||||||
if (Playing())
|
|
||||||
P_RestoreMusic(&players[consoleplayer]);
|
|
||||||
else
|
|
||||||
S_ChangeMusicInternal("_clear", false);
|
|
||||||
//M_StartMessage(M_GetText("Digital Music Enabled\n"), NULL, MM_NOTHING);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (digital_disabled)
|
if (digital_disabled)
|
||||||
{
|
{
|
||||||
digital_disabled = false;
|
digital_disabled = false;
|
||||||
|
I_InitMusic();
|
||||||
|
if (digital_disabled) return;
|
||||||
|
S_StopMusic();
|
||||||
if (Playing())
|
if (Playing())
|
||||||
P_RestoreMusic(&players[consoleplayer]);
|
P_RestoreMusic(&players[consoleplayer]);
|
||||||
else
|
else
|
||||||
|
@ -9500,7 +9488,6 @@ static void M_ToggleDigital(INT32 choice)
|
||||||
//M_StartMessage(M_GetText("Digital Music Disabled\n"), NULL, MM_NOTHING);
|
//M_StartMessage(M_GetText("Digital Music Disabled\n"), NULL, MM_NOTHING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void M_ToggleMIDI(INT32 choice)
|
static void M_ToggleMIDI(INT32 choice)
|
||||||
{
|
{
|
||||||
|
@ -9526,12 +9513,11 @@ static void M_ToggleMIDI(INT32 choice)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nomidimusic)
|
if (midi_disabled)
|
||||||
{
|
{
|
||||||
nomidimusic = false;
|
midi_disabled = false;
|
||||||
I_InitMusic();
|
I_InitMusic();
|
||||||
if (nomidimusic) return;
|
if (midi_disabled) return;
|
||||||
S_InitSfxChannels(cv_soundvolume.value);
|
|
||||||
if (Playing())
|
if (Playing())
|
||||||
P_RestoreMusic(&players[consoleplayer]);
|
P_RestoreMusic(&players[consoleplayer]);
|
||||||
else
|
else
|
||||||
|
@ -9540,23 +9526,11 @@ static void M_ToggleMIDI(INT32 choice)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (music_disabled)
|
midi_disabled = true;
|
||||||
{
|
|
||||||
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();
|
S_StopMusic();
|
||||||
//M_StartMessage(M_GetText("MIDI Music Disabled\n"), NULL, MM_NOTHING);
|
//M_StartMessage(M_GetText("MIDI Music Disabled\n"), NULL, MM_NOTHING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// ===============
|
// ===============
|
||||||
// VIDEO MODE MENU
|
// VIDEO MODE MENU
|
||||||
|
|
|
@ -9172,7 +9172,7 @@ void P_PrecipitationEffects(void)
|
||||||
if (!playeringame[displayplayer] || !players[displayplayer].mo)
|
if (!playeringame[displayplayer] || !players[displayplayer].mo)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (nosound || sound_disabled)
|
if (sound_disabled)
|
||||||
return; // Sound off? D'aw, no fun.
|
return; // Sound off? D'aw, no fun.
|
||||||
|
|
||||||
if (players[displayplayer].mo->subsector->sector->ceilingpic == skyflatnum)
|
if (players[displayplayer].mo->subsector->sector->ceilingpic == skyflatnum)
|
||||||
|
|
|
@ -230,7 +230,7 @@ void S_RegisterSoundStuff(void)
|
||||||
{
|
{
|
||||||
if (dedicated)
|
if (dedicated)
|
||||||
{
|
{
|
||||||
nosound = true;
|
sound_disabled = true;
|
||||||
return;
|
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 *listenmobj = players[displayplayer].mo;
|
||||||
mobj_t *listenmobj2 = NULL;
|
mobj_t *listenmobj2 = NULL;
|
||||||
|
|
||||||
if (sound_disabled || !sound_started || nosound)
|
if (sound_disabled || !sound_started)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Don't want a sound? Okay then...
|
// Don't want a sound? Okay then...
|
||||||
|
@ -824,7 +824,7 @@ void S_UpdateSounds(void)
|
||||||
goto notinlevel;
|
goto notinlevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dedicated || nosound)
|
if (dedicated || sound_disabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (players[displayplayer].awayviewtics)
|
if (players[displayplayer].awayviewtics)
|
||||||
|
@ -1307,7 +1307,7 @@ void S_InitSfxChannels(INT32 sfxVolume)
|
||||||
}
|
}
|
||||||
|
|
||||||
// precache sounds if requested by cmdline, or precachesound var true
|
// 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.
|
// Initialize external data (all sounds) at start, keep static.
|
||||||
CONS_Printf(M_GetText("Loading sounds... "));
|
CONS_Printf(M_GetText("Loading sounds... "));
|
||||||
|
@ -1352,24 +1352,19 @@ static char music_name[7]; // up to 6-character name
|
||||||
/// Music Status
|
/// 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 (
|
return (midi_disabled && digital_disabled);
|
||||||
(nodigimusic && nomidimusic) ||
|
|
||||||
(music_disabled && digital_disabled) ||
|
|
||||||
(nodigimusic && music_disabled) ||
|
|
||||||
(nomidimusic && digital_disabled)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean S_MusicPlaying(void)
|
boolean S_MusicPlaying(void)
|
||||||
|
@ -1453,7 +1448,7 @@ static void S_UnloadMusic(void)
|
||||||
|
|
||||||
static boolean S_PlayMusic(boolean looping)
|
static boolean S_PlayMusic(boolean looping)
|
||||||
{
|
{
|
||||||
if (nodigimusic || digital_disabled)
|
if (S_DigMusicDisabled())
|
||||||
return false; // try midi
|
return false; // try midi
|
||||||
|
|
||||||
if (!I_PlaySong(looping))
|
if (!I_PlaySong(looping))
|
||||||
|
|
Loading…
Reference in a new issue