mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-04-19 16:51:53 +00:00
Merge branch 'cleanupmusic' into 'next'
Music options cleanup + bugfixes Closes #76, #273, and #980 See merge request STJr/SRB2!1950
This commit is contained in:
commit
eefa2ba42c
13 changed files with 116 additions and 262 deletions
28
src/d_main.c
28
src/d_main.c
|
@ -117,9 +117,8 @@ INT32 postimgparam2;
|
|||
// 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;
|
||||
boolean music_disabled = false;
|
||||
|
||||
//
|
||||
// DEMO LOOP
|
||||
|
@ -1554,36 +1553,21 @@ void D_SRB2Main(void)
|
|||
if (dedicated)
|
||||
{
|
||||
sound_disabled = true;
|
||||
midi_disabled = digital_disabled = true;
|
||||
music_disabled = true;
|
||||
}
|
||||
if (M_CheckParm("-noaudio")) // combines -nosound and -nomusic
|
||||
{
|
||||
sound_disabled = true;
|
||||
digital_disabled = true;
|
||||
midi_disabled = true;
|
||||
music_disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (M_CheckParm("-nosound"))
|
||||
sound_disabled = true;
|
||||
if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic
|
||||
{
|
||||
digital_disabled = true;
|
||||
midi_disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (M_CheckParm("-nomidimusic"))
|
||||
midi_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
|
||||
if (M_CheckParm("-nodigmusic"))
|
||||
digital_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
|
||||
}
|
||||
if (M_CheckParm("-nomusic"))
|
||||
music_disabled = true;
|
||||
}
|
||||
if (!( sound_disabled && digital_disabled
|
||||
#ifndef NO_MIDI
|
||||
&& midi_disabled
|
||||
#endif
|
||||
))
|
||||
if (!(sound_disabled && music_disabled))
|
||||
{
|
||||
CONS_Printf("S_InitSfxChannels(): Setting up sound channels.\n");
|
||||
I_StartupSound();
|
||||
|
|
|
@ -1674,7 +1674,6 @@ void readlevelheader(MYFILE *f, INT32 num)
|
|||
else i = -1; // (fastcmp(word2, "DEFAULT"))
|
||||
|
||||
if (i >= -1 && i <= 1) // -1 to force off, 1 to force on, 0 to honor default.
|
||||
// This behavior can be disabled with cv_resetmusicbyheader
|
||||
mapheaderinfo[num-1]->musforcereset = (SINT8)i;
|
||||
else
|
||||
deh_warning("Level header %d: invalid forceresetmusic option %d", num, i);
|
||||
|
|
|
@ -5834,6 +5834,11 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"BASEVIDWIDTH",BASEVIDWIDTH},
|
||||
{"BASEVIDHEIGHT",BASEVIDHEIGHT},
|
||||
|
||||
// Music flags & stuff
|
||||
{"MUSIC_TRACKMASK", MUSIC_TRACKMASK},
|
||||
{"MUSIC_FORCERESET", MUSIC_FORCERESET},
|
||||
{"MUSIC_RELOADRESET", MUSIC_RELOADRESET},
|
||||
|
||||
{NULL,0}
|
||||
};
|
||||
|
||||
|
|
|
@ -108,9 +108,8 @@ extern boolean fromlevelselect;
|
|||
// Internal parameters for sound rendering.
|
||||
// ========================================
|
||||
|
||||
extern boolean midi_disabled;
|
||||
extern boolean sound_disabled;
|
||||
extern boolean digital_disabled;
|
||||
extern boolean music_disabled;
|
||||
|
||||
// =========================
|
||||
// Status flags for refresh.
|
||||
|
|
|
@ -2775,13 +2775,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
|
||||
if (p-players == consoleplayer)
|
||||
{
|
||||
if (mapmusflags & MUSIC_RELOADRESET)
|
||||
{
|
||||
strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7);
|
||||
mapmusname[6] = 0;
|
||||
mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK);
|
||||
mapmusposition = mapheaderinfo[gamemap-1]->muspos;
|
||||
}
|
||||
if ((mapmusflags & MUSIC_RELOADRESET) && !(mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD || netgame))
|
||||
S_ReloadReset();
|
||||
|
||||
// This is in S_Start, but this was not here previously.
|
||||
// if (RESETMUSIC)
|
||||
|
|
45
src/m_menu.c
45
src/m_menu.c
|
@ -1439,33 +1439,30 @@ static menuitem_t OP_OpenGLLightingMenu[] =
|
|||
static menuitem_t OP_SoundOptionsMenu[] =
|
||||
{
|
||||
{IT_HEADER, NULL, "Game Audio", NULL, 0},
|
||||
{IT_STRING | IT_CVAR, NULL, "Sound Effects", &cv_gamesounds, 6},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Sound Volume", &cv_soundvolume, 11},
|
||||
{IT_STRING | IT_CVAR, NULL, "Sound Effects", &cv_gamesounds, 12},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Sound Volume", &cv_soundvolume, 22},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Digital Music", &cv_gamedigimusic, 21},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Digital Music Volume", &cv_digmusicvolume, 26},
|
||||
{IT_STRING | IT_CVAR, NULL, "Music", &cv_gamedigimusic, 42},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Music Volume", &cv_digmusicvolume, 52},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Music Preference", &cv_musicpref, 72},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "MIDI Music", &cv_gamemidimusic, 36},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "MIDI Music Volume", &cv_midimusicvolume, 41},
|
||||
{IT_HEADER, NULL, "Miscellaneous", NULL, 90},
|
||||
{IT_STRING | IT_CVAR, NULL, "Closed Captioning", &cv_closedcaptioning, 102},
|
||||
{IT_STRING | IT_CVAR, NULL, "Default 1-Up sound", &cv_1upsound, 112},
|
||||
{IT_STRING | IT_CVAR, NULL, "Reset Music Upon Dying", &cv_resetmusic, 122},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Music Preference", &cv_musicpref, 51},
|
||||
|
||||
{IT_HEADER, NULL, "Miscellaneous", NULL, 61},
|
||||
{IT_STRING | IT_CVAR, NULL, "Closed Captioning", &cv_closedcaptioning, 67},
|
||||
{IT_STRING | IT_CVAR, NULL, "Reset Music Upon Dying", &cv_resetmusic, 72},
|
||||
{IT_STRING | IT_CVAR, NULL, "Default 1-Up sound", &cv_1upsound, 77},
|
||||
|
||||
{IT_STRING | IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 87},
|
||||
{IT_STRING | IT_SUBMENU, NULL, "Advanced/MIDI Settings...", &OP_SoundAdvancedDef, 142},
|
||||
};
|
||||
|
||||
#ifdef HAVE_OPENMPT
|
||||
#define OPENMPT_MENUOFFSET 32
|
||||
#define OPENMPT_MENUOFFSET 30
|
||||
#else
|
||||
#define OPENMPT_MENUOFFSET 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MIXERX
|
||||
#define MIXERX_MENUOFFSET 81
|
||||
#define MIXERX_MENUOFFSET 90
|
||||
#else
|
||||
#define MIXERX_MENUOFFSET 0
|
||||
#endif
|
||||
|
@ -1479,15 +1476,15 @@ static menuitem_t OP_SoundAdvancedMenu[] =
|
|||
|
||||
#ifdef HAVE_MIXERX
|
||||
{IT_HEADER, NULL, "MIDI Settings", NULL, OPENMPT_MENUOFFSET},
|
||||
{IT_STRING | IT_CVAR, NULL, "MIDI Player", &cv_midiplayer, OPENMPT_MENUOFFSET+12},
|
||||
{IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "FluidSynth Sound Font File", &cv_midisoundfontpath, OPENMPT_MENUOFFSET+24},
|
||||
{IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "TiMidity++ Config Folder", &cv_miditimiditypath, OPENMPT_MENUOFFSET+51},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "MIDI Volume", &cv_midimusicvolume, OPENMPT_MENUOFFSET+12},
|
||||
{IT_STRING | IT_CVAR, NULL, "MIDI Player", &cv_midiplayer, OPENMPT_MENUOFFSET+22},
|
||||
{IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "FluidSynth Sound Font File", &cv_midisoundfontpath, OPENMPT_MENUOFFSET+32},
|
||||
{IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "TiMidity++ Config Folder", &cv_miditimiditypath, OPENMPT_MENUOFFSET+59},
|
||||
#endif
|
||||
|
||||
{IT_HEADER, NULL, "Miscellaneous", NULL, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET},
|
||||
{IT_HEADER, NULL, "Focus settings", NULL, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET},
|
||||
{IT_STRING | IT_CVAR, NULL, "Play Sound Effects if Unfocused", &cv_playsoundsifunfocused, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+12},
|
||||
{IT_STRING | IT_CVAR, NULL, "Play Music if Unfocused", &cv_playmusicifunfocused, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+22},
|
||||
{IT_STRING | IT_CVAR, NULL, "Let Levels Force Reset Music", &cv_resetmusicbyheader, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+32},
|
||||
};
|
||||
|
||||
#undef OPENMPT_MENUOFFSET
|
||||
|
@ -2159,7 +2156,7 @@ menu_t OP_ColorOptionsDef =
|
|||
0,
|
||||
NULL
|
||||
};
|
||||
menu_t OP_SoundOptionsDef = DEFAULTSCROLLMENUSTYLE(
|
||||
menu_t OP_SoundOptionsDef = DEFAULTMENUSTYLE(
|
||||
MTREE2(MN_OP_MAIN, MN_OP_SOUND),
|
||||
"M_SOUND", OP_SoundOptionsMenu, &OP_MainDef, 30, 30);
|
||||
menu_t OP_SoundAdvancedDef = DEFAULTMENUSTYLE(
|
||||
|
@ -2925,7 +2922,7 @@ static void M_HandleMenuPresState(menu_t *newMenu)
|
|||
}
|
||||
|
||||
// Change the music
|
||||
M_ChangeMenuMusic("_title", false);
|
||||
M_ChangeMenuMusic("_title", looptitle);
|
||||
|
||||
// Run the linedef execs
|
||||
if (titlemapinaction)
|
||||
|
@ -10661,7 +10658,7 @@ static void M_ModeAttackEndGame(INT32 choice)
|
|||
M_UpdateItemOn();
|
||||
G_SetGamestate(GS_TIMEATTACK);
|
||||
modeattacking = ATTACKING_NONE;
|
||||
M_ChangeMenuMusic("_title", true);
|
||||
M_ChangeMenuMusic("_title", looptitle);
|
||||
Nextmap_OnChange();
|
||||
}
|
||||
|
||||
|
|
|
@ -901,9 +901,9 @@ void D_RegisterClientCommands(void)
|
|||
|
||||
// s_sound.c
|
||||
CV_RegisterVar(&cv_soundvolume);
|
||||
CV_RegisterVar(&cv_closedcaptioning);
|
||||
CV_RegisterVar(&cv_digmusicvolume);
|
||||
CV_RegisterVar(&cv_midimusicvolume);
|
||||
CV_RegisterVar(&cv_closedcaptioning);
|
||||
CV_RegisterVar(&cv_numChannels);
|
||||
|
||||
// screen.c
|
||||
|
|
|
@ -3784,7 +3784,7 @@ static void P_DoBossVictory(mobj_t *mo)
|
|||
}
|
||||
|
||||
if (mapheaderinfo[gamemap-1]->muspostbossname[0] &&
|
||||
S_MusicExists(mapheaderinfo[gamemap-1]->muspostbossname, !midi_disabled, !digital_disabled))
|
||||
S_MusicPrefExists(mapheaderinfo[gamemap-1]->muspostbossname))
|
||||
{
|
||||
// Touching the egg trap button calls P_DoPlayerExit, which calls P_RestoreMusic.
|
||||
// So just park ourselves in the mapmus variables.
|
||||
|
|
232
src/s_sound.c
232
src/s_sound.c
|
@ -44,9 +44,8 @@ static void Command_Tunes_f(void);
|
|||
static void Command_RestartAudio_f(void);
|
||||
|
||||
// Sound system toggles
|
||||
static void GameMIDIMusic_OnChange(void);
|
||||
static void GameSounds_OnChange(void);
|
||||
static void GameDigiMusic_OnChange(void);
|
||||
static void GameMusic_OnChange(void);
|
||||
static void MusicPref_OnChange(void);
|
||||
|
||||
#ifdef HAVE_OPENMPT
|
||||
|
@ -93,7 +92,6 @@ consvar_t cv_numChannels = CVAR_INIT ("snd_channels", "32", CV_SAVE|CV_CALL, CV_
|
|||
static consvar_t surround = CVAR_INIT ("surround", "Off", CV_SAVE, CV_OnOff, NULL);
|
||||
|
||||
consvar_t cv_resetmusic = CVAR_INIT ("resetmusic", "Off", CV_SAVE, CV_OnOff, NULL);
|
||||
consvar_t cv_resetmusicbyheader = CVAR_INIT ("resetmusicbyheader", "Yes", CV_SAVE, CV_YesNo, NULL);
|
||||
|
||||
static CV_PossibleValue_t cons_1upsound_t[] = {
|
||||
{0, "Jingle"},
|
||||
|
@ -103,8 +101,7 @@ static CV_PossibleValue_t cons_1upsound_t[] = {
|
|||
consvar_t cv_1upsound = CVAR_INIT ("1upsound", "Jingle", CV_SAVE, cons_1upsound_t, NULL);
|
||||
|
||||
// Sound system toggles, saved into the config
|
||||
consvar_t cv_gamedigimusic = CVAR_INIT ("digimusic", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameDigiMusic_OnChange);
|
||||
consvar_t cv_gamemidimusic = CVAR_INIT ("midimusic", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameMIDIMusic_OnChange);
|
||||
consvar_t cv_gamedigimusic = CVAR_INIT ("digimusic", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameMusic_OnChange);
|
||||
consvar_t cv_gamesounds = CVAR_INIT ("sounds", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameSounds_OnChange);
|
||||
|
||||
// Music preference
|
||||
|
@ -167,8 +164,7 @@ caption_t closedcaptions[NUMCAPTIONS];
|
|||
|
||||
void S_ResetCaptions(void)
|
||||
{
|
||||
UINT8 i;
|
||||
for (i = 0; i < NUMCAPTIONS; i++)
|
||||
for (UINT8 i = 0; i < NUMCAPTIONS; i++)
|
||||
{
|
||||
closedcaptions[i].c = NULL;
|
||||
closedcaptions[i].s = NULL;
|
||||
|
@ -272,13 +268,11 @@ void S_RegisterSoundStuff(void)
|
|||
CV_RegisterVar(&surround);
|
||||
CV_RegisterVar(&cv_samplerate);
|
||||
CV_RegisterVar(&cv_resetmusic);
|
||||
CV_RegisterVar(&cv_resetmusicbyheader);
|
||||
CV_RegisterVar(&cv_1upsound);
|
||||
CV_RegisterVar(&cv_playsoundsifunfocused);
|
||||
CV_RegisterVar(&cv_playmusicifunfocused);
|
||||
CV_RegisterVar(&cv_gamesounds);
|
||||
CV_RegisterVar(&cv_gamedigimusic);
|
||||
CV_RegisterVar(&cv_gamemidimusic);
|
||||
CV_RegisterVar(&cv_musicpref);
|
||||
#ifdef HAVE_OPENMPT
|
||||
CV_RegisterVar(&cv_modfilter);
|
||||
|
@ -295,8 +289,6 @@ void S_RegisterSoundStuff(void)
|
|||
|
||||
static void SetChannelsNum(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
// Allocating the internal channels for mixing
|
||||
// (the maximum number of sounds rendered
|
||||
// simultaneously) within zone memory.
|
||||
|
@ -306,7 +298,6 @@ static void SetChannelsNum(void)
|
|||
Z_Free(channels);
|
||||
channels = NULL;
|
||||
|
||||
|
||||
if (cv_numChannels.value == 999999999) //Alam_GBC: OH MY ROD!(ROD rimmiced with GOD!)
|
||||
CV_StealthSet(&cv_numChannels,cv_numChannels.defaultvalue);
|
||||
|
||||
|
@ -322,7 +313,7 @@ static void SetChannelsNum(void)
|
|||
numofchannels = cv_numChannels.value;
|
||||
|
||||
// Free all channels for use
|
||||
for (i = 0; i < numofchannels; i++)
|
||||
for (INT32 i = 0; i < numofchannels; i++)
|
||||
channels[i].sfxinfo = 0;
|
||||
|
||||
S_ResetCaptions();
|
||||
|
@ -357,17 +348,12 @@ lumpnum_t S_GetSfxLumpNum(sfxinfo_t *sfx)
|
|||
|
||||
boolean S_SoundDisabled(void)
|
||||
{
|
||||
return (
|
||||
sound_disabled ||
|
||||
( window_notinfocus && ! cv_playsoundsifunfocused.value )
|
||||
);
|
||||
return sound_disabled || (window_notinfocus && !cv_playsoundsifunfocused.value);
|
||||
}
|
||||
|
||||
// Stop all sounds, load level info, THEN start sounds.
|
||||
void S_StopSounds(void)
|
||||
{
|
||||
INT32 cnum;
|
||||
|
||||
#ifdef HW3SOUND
|
||||
if (hws_mode != HWS_DEFAULT_MODE)
|
||||
{
|
||||
|
@ -377,7 +363,7 @@ void S_StopSounds(void)
|
|||
#endif
|
||||
|
||||
// kill all playing sounds at start of level
|
||||
for (cnum = 0; cnum < numofchannels; cnum++)
|
||||
for (INT32 cnum = 0; cnum < numofchannels; cnum++)
|
||||
if (channels[cnum].sfxinfo)
|
||||
S_StopChannel(cnum);
|
||||
|
||||
|
@ -386,8 +372,6 @@ void S_StopSounds(void)
|
|||
|
||||
void S_StopSoundByID(void *origin, sfxenum_t sfx_id)
|
||||
{
|
||||
INT32 cnum;
|
||||
|
||||
// Sounds without origin can have multiple sources, they shouldn't
|
||||
// be stopped by new sounds.
|
||||
if (!origin)
|
||||
|
@ -399,7 +383,7 @@ void S_StopSoundByID(void *origin, sfxenum_t sfx_id)
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
for (cnum = 0; cnum < numofchannels; cnum++)
|
||||
for (INT32 cnum = 0; cnum < numofchannels; cnum++)
|
||||
{
|
||||
if (channels[cnum].sfxinfo == &S_sfx[sfx_id] && channels[cnum].origin == origin)
|
||||
{
|
||||
|
@ -411,8 +395,6 @@ void S_StopSoundByID(void *origin, sfxenum_t sfx_id)
|
|||
|
||||
void S_StopSoundByNum(sfxenum_t sfxnum)
|
||||
{
|
||||
INT32 cnum;
|
||||
|
||||
#ifdef HW3SOUND
|
||||
if (hws_mode != HWS_DEFAULT_MODE)
|
||||
{
|
||||
|
@ -420,7 +402,7 @@ void S_StopSoundByNum(sfxenum_t sfxnum)
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
for (cnum = 0; cnum < numofchannels; cnum++)
|
||||
for (INT32 cnum = 0; cnum < numofchannels; cnum++)
|
||||
{
|
||||
if (channels[cnum].sfxinfo == &S_sfx[sfxnum])
|
||||
{
|
||||
|
@ -797,8 +779,6 @@ void S_StartSound(const void *origin, sfxenum_t sfx_id)
|
|||
|
||||
void S_StopSound(void *origin)
|
||||
{
|
||||
INT32 cnum;
|
||||
|
||||
// Sounds without origin can have multiple sources, they shouldn't
|
||||
// be stopped by new sounds.
|
||||
if (!origin)
|
||||
|
@ -811,7 +791,7 @@ void S_StopSound(void *origin)
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
for (cnum = 0; cnum < numofchannels; cnum++)
|
||||
for (INT32 cnum = 0; cnum < numofchannels; cnum++)
|
||||
{
|
||||
if (channels[cnum].sfxinfo && channels[cnum].origin == origin)
|
||||
{
|
||||
|
@ -825,8 +805,7 @@ void S_StopSound(void *origin)
|
|||
// Updates music & sounds
|
||||
//
|
||||
static INT32 actualsfxvolume; // check for change through console
|
||||
static INT32 actualdigmusicvolume;
|
||||
static INT32 actualmidimusicvolume;
|
||||
static INT32 actualmusicvolume;
|
||||
|
||||
void S_UpdateSounds(void)
|
||||
{
|
||||
|
@ -838,17 +817,17 @@ void S_UpdateSounds(void)
|
|||
|
||||
mobj_t *listenmobj = players[displayplayer].mo;
|
||||
mobj_t *listenmobj2 = NULL;
|
||||
|
||||
boolean currentmidi = (I_SongType() == MU_MID || I_SongType() == MU_MID_EX);
|
||||
|
||||
memset(&listener, 0, sizeof(listener_t));
|
||||
memset(&listener2, 0, sizeof(listener_t));
|
||||
|
||||
// Update sound/music volumes, if changed manually at console
|
||||
if (actualsfxvolume != cv_soundvolume.value)
|
||||
S_SetSfxVolume (cv_soundvolume.value);
|
||||
if (actualdigmusicvolume != cv_digmusicvolume.value)
|
||||
S_SetDigMusicVolume (cv_digmusicvolume.value);
|
||||
if (actualmidimusicvolume != cv_midimusicvolume.value)
|
||||
S_SetMIDIMusicVolume (cv_midimusicvolume.value);
|
||||
S_SetSfxVolume(cv_soundvolume.value);
|
||||
if (actualmusicvolume != currentmidi ? cv_midimusicvolume.value : cv_digmusicvolume.value)
|
||||
S_SetMusicVolume(-1);
|
||||
|
||||
// We're done now, if we're not in a level.
|
||||
if (gamestate != GS_LEVEL)
|
||||
|
@ -991,9 +970,8 @@ notinlevel:
|
|||
|
||||
void S_UpdateClosedCaptions(void)
|
||||
{
|
||||
UINT8 i;
|
||||
boolean gamestopped = (paused || P_AutoPause());
|
||||
for (i = 0; i < NUMCAPTIONS; i++) // update captions
|
||||
for (UINT8 i = 0; i < NUMCAPTIONS; i++) // update captions
|
||||
{
|
||||
if (!closedcaptions[i].s)
|
||||
continue;
|
||||
|
@ -1210,7 +1188,6 @@ INT32 S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *v
|
|||
// on the given origin.
|
||||
INT32 S_OriginPlaying(void *origin)
|
||||
{
|
||||
INT32 cnum;
|
||||
if (!origin)
|
||||
return false;
|
||||
|
||||
|
@ -1219,7 +1196,7 @@ INT32 S_OriginPlaying(void *origin)
|
|||
return HW3S_OriginPlaying(origin);
|
||||
#endif
|
||||
|
||||
for (cnum = 0; cnum < numofchannels; cnum++)
|
||||
for (INT32 cnum = 0; cnum < numofchannels; cnum++)
|
||||
if (channels[cnum].origin == origin)
|
||||
return 1;
|
||||
return 0;
|
||||
|
@ -1229,14 +1206,12 @@ INT32 S_OriginPlaying(void *origin)
|
|||
// is playing anywhere.
|
||||
INT32 S_IdPlaying(sfxenum_t id)
|
||||
{
|
||||
INT32 cnum;
|
||||
|
||||
#ifdef HW3SOUND
|
||||
if (hws_mode != HWS_DEFAULT_MODE)
|
||||
return HW3S_IdPlaying(id);
|
||||
#endif
|
||||
|
||||
for (cnum = 0; cnum < numofchannels; cnum++)
|
||||
for (INT32 cnum = 0; cnum < numofchannels; cnum++)
|
||||
if ((size_t)(channels[cnum].sfxinfo - S_sfx) == (size_t)id)
|
||||
return 1;
|
||||
return 0;
|
||||
|
@ -1246,7 +1221,6 @@ INT32 S_IdPlaying(sfxenum_t id)
|
|||
// origin x playing sound id y.
|
||||
INT32 S_SoundPlaying(void *origin, sfxenum_t id)
|
||||
{
|
||||
INT32 cnum;
|
||||
if (!origin)
|
||||
return 0;
|
||||
|
||||
|
@ -1255,7 +1229,7 @@ INT32 S_SoundPlaying(void *origin, sfxenum_t id)
|
|||
return HW3S_SoundPlaying(origin, id);
|
||||
#endif
|
||||
|
||||
for (cnum = 0; cnum < numofchannels; cnum++)
|
||||
for (INT32 cnum = 0; cnum < numofchannels; cnum++)
|
||||
{
|
||||
if (channels[cnum].origin == origin
|
||||
&& (size_t)(channels[cnum].sfxinfo - S_sfx) == (size_t)id)
|
||||
|
@ -1676,8 +1650,7 @@ void S_LoadMusicDefs(UINT16 wadnum)
|
|||
//
|
||||
void S_InitMusicDefs(void)
|
||||
{
|
||||
UINT16 i;
|
||||
for (i = 0; i < numwadfiles; i++)
|
||||
for (UINT16 i = 0; i < numwadfiles; i++)
|
||||
S_LoadMusicDefs(i);
|
||||
}
|
||||
|
||||
|
@ -1733,19 +1706,9 @@ boolean S_PrepareSoundTest(void)
|
|||
/// Music Status
|
||||
/// ------------------------
|
||||
|
||||
boolean S_DigMusicDisabled(void)
|
||||
{
|
||||
return digital_disabled;
|
||||
}
|
||||
|
||||
boolean S_MIDIMusicDisabled(void)
|
||||
{
|
||||
return midi_disabled;
|
||||
}
|
||||
|
||||
boolean S_MusicDisabled(void)
|
||||
{
|
||||
return (midi_disabled && digital_disabled);
|
||||
return music_disabled;
|
||||
}
|
||||
|
||||
boolean S_MusicPlaying(void)
|
||||
|
@ -1760,9 +1723,7 @@ boolean S_MusicPaused(void)
|
|||
|
||||
boolean S_MusicNotInFocus(void)
|
||||
{
|
||||
return (
|
||||
( window_notinfocus && ! cv_playmusicifunfocused.value )
|
||||
);
|
||||
return window_notinfocus && !cv_playmusicifunfocused.value;
|
||||
}
|
||||
|
||||
musictype_t S_MusicType(void)
|
||||
|
@ -1775,6 +1736,11 @@ const char *S_MusicName(void)
|
|||
return music_name;
|
||||
}
|
||||
|
||||
boolean S_MusicPrefExists(const char *mname)
|
||||
{
|
||||
return (W_CheckNumForName(va((cv_musicpref.value ? "D_%s" : "O_%s"), mname)) != LUMPERROR);
|
||||
}
|
||||
|
||||
boolean S_MusicExists(const char *mname, boolean checkMIDI, boolean checkDigi)
|
||||
{
|
||||
return (
|
||||
|
@ -1970,7 +1936,7 @@ static musicstack_t *S_GetMusicStackEntry(UINT16 status, boolean fromfirst, INT1
|
|||
{
|
||||
if (P_EvaluateMusicStatus(mst->status, mst->musname))
|
||||
{
|
||||
if (!S_MusicExists(mst->musname, !midi_disabled, !digital_disabled)) // paranoia
|
||||
if (!S_MusicPrefExists(mst->musname)) // paranoia
|
||||
S_RemoveMusicStackEntry(mst); // then continue
|
||||
else
|
||||
return mst;
|
||||
|
@ -2016,14 +1982,13 @@ boolean S_RecallMusic(UINT16 status, boolean fromfirst)
|
|||
musicstack_t *result;
|
||||
musicstack_t *entry = Z_Calloc(sizeof (*result), PU_MUSIC, NULL);
|
||||
boolean currentmidi = (I_SongType() == MU_MID || I_SongType() == MU_MID_EX);
|
||||
boolean midipref = cv_musicpref.value;
|
||||
|
||||
if (status)
|
||||
result = S_GetMusicStackEntry(status, fromfirst, -1);
|
||||
else
|
||||
result = S_GetMusicStackEntry(JT_NONE, false, -1);
|
||||
|
||||
if (result && !S_MusicExists(result->musname, !midi_disabled, !digital_disabled))
|
||||
if (result && !S_MusicPrefExists(result->musname))
|
||||
{
|
||||
Z_Free(entry);
|
||||
return false; // music doesn't exist, so don't do anything
|
||||
|
@ -2072,7 +2037,7 @@ boolean S_RecallMusic(UINT16 status, boolean fromfirst)
|
|||
}
|
||||
|
||||
if (strncmp(entry->musname, S_MusicName(), 7) || // don't restart music if we're already playing it
|
||||
(midipref != currentmidi && S_PrefAvailable(midipref, entry->musname))) // but do if the user's preference has changed
|
||||
(cv_musicpref.value != currentmidi && S_MusicPrefExists(entry->musname))) // but do if the user's preference has changed
|
||||
{
|
||||
if (music_stack_fadeout)
|
||||
S_ChangeMusicEx(entry->musname, entry->musflags, entry->looping, 0, music_stack_fadeout, 0);
|
||||
|
@ -2119,14 +2084,10 @@ boolean S_RecallMusic(UINT16 status, boolean fromfirst)
|
|||
|
||||
static lumpnum_t S_GetMusicLumpNum(const char *mname)
|
||||
{
|
||||
boolean midipref = cv_musicpref.value;
|
||||
|
||||
if (S_PrefAvailable(midipref, mname))
|
||||
return W_GetNumForName(va(midipref ? "d_%s":"o_%s", mname));
|
||||
else if (S_PrefAvailable(!midipref, mname))
|
||||
return W_GetNumForName(va(midipref ? "o_%s":"d_%s", mname));
|
||||
else
|
||||
return LUMPERROR;
|
||||
if (S_MusicPrefExists(mname))
|
||||
return W_CheckNumForName(va(cv_musicpref.value ? "d_%s":"o_%s", mname));
|
||||
else // see if the other music type exists
|
||||
return W_CheckNumForName(va(cv_musicpref.value ? "o_%s":"d_%s", mname));
|
||||
}
|
||||
|
||||
static boolean S_LoadMusic(const char *mname)
|
||||
|
@ -2203,7 +2164,7 @@ static boolean S_PlayMusic(boolean looping, UINT32 fadeinms)
|
|||
}
|
||||
}
|
||||
|
||||
S_InitMusicVolume(); // switch between digi and sequence volume
|
||||
S_SetMusicVolume(-1); // initialize music volume
|
||||
|
||||
if (S_MusicNotInFocus())
|
||||
S_PauseAudio();
|
||||
|
@ -2250,7 +2211,6 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
|
|||
};
|
||||
|
||||
boolean currentmidi = (I_SongType() == MU_MID || I_SongType() == MU_MID_EX);
|
||||
boolean midipref = cv_musicpref.value;
|
||||
|
||||
if (S_MusicDisabled())
|
||||
return;
|
||||
|
@ -2279,7 +2239,7 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
|
|||
return;
|
||||
}
|
||||
else if (strnicmp(music_name, newmusic, 6) || (mflags & MUSIC_FORCERESET) ||
|
||||
(midipref != currentmidi && S_PrefAvailable(midipref, newmusic)))
|
||||
(cv_musicpref.value != currentmidi && S_MusicPrefExists(newmusic)))
|
||||
{
|
||||
CONS_Debug(DBG_DETAILED, "Now playing song %s\n", newmusic);
|
||||
|
||||
|
@ -2303,7 +2263,7 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
|
|||
{
|
||||
I_SetSongPosition(position);
|
||||
I_FadeSong(100, fadeinms, NULL);
|
||||
}
|
||||
}
|
||||
else // reset volume to 100 with same music
|
||||
{
|
||||
I_StopFadingSong();
|
||||
|
@ -2362,35 +2322,20 @@ void S_ResumeAudio(void)
|
|||
S_AdjustMusicStackTics();
|
||||
}
|
||||
|
||||
void S_SetMusicVolume(INT32 digvolume, INT32 seqvolume)
|
||||
void S_SetMusicVolume(INT32 volume)
|
||||
{
|
||||
if (digvolume < 0)
|
||||
digvolume = cv_digmusicvolume.value;
|
||||
if (seqvolume < 0)
|
||||
seqvolume = cv_midimusicvolume.value;
|
||||
consvar_t *musicvolume = (I_SongType() == MU_MID || I_SongType() == MU_MID_EX) ? &cv_midimusicvolume : &cv_digmusicvolume;
|
||||
|
||||
if (digvolume < 0 || digvolume > 31)
|
||||
CONS_Alert(CONS_WARNING, "digmusicvolume should be between 0-31\n");
|
||||
CV_SetValue(&cv_digmusicvolume, digvolume&31);
|
||||
actualdigmusicvolume = cv_digmusicvolume.value; //check for change of var
|
||||
if (volume < 0)
|
||||
volume = musicvolume->value;
|
||||
|
||||
if (seqvolume < 0 || seqvolume > 31)
|
||||
CONS_Alert(CONS_WARNING, "midimusicvolume should be between 0-31\n");
|
||||
CV_SetValue(&cv_midimusicvolume, seqvolume&31);
|
||||
actualmidimusicvolume = cv_midimusicvolume.value; //check for change of var
|
||||
if (volume < 0 || volume > 31)
|
||||
CONS_Alert(CONS_WARNING, "Music volume should be between 0-31\n");
|
||||
|
||||
switch(I_SongType())
|
||||
{
|
||||
case MU_MID:
|
||||
case MU_MID_EX:
|
||||
//case MU_MOD:
|
||||
//case MU_GME:
|
||||
I_SetMusicVolume(seqvolume&31);
|
||||
break;
|
||||
default:
|
||||
I_SetMusicVolume(digvolume&31);
|
||||
break;
|
||||
}
|
||||
CV_SetValue(musicvolume, volume&31);
|
||||
actualmusicvolume = musicvolume->value; //check for change of var
|
||||
|
||||
I_SetMusicVolume(volume&31);
|
||||
}
|
||||
|
||||
/// ------------------------
|
||||
|
@ -2431,13 +2376,8 @@ boolean S_FadeOutStopMusic(UINT32 ms)
|
|||
//
|
||||
void S_StartEx(boolean reset)
|
||||
{
|
||||
if (mapmusflags & MUSIC_RELOADRESET)
|
||||
{
|
||||
strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7);
|
||||
mapmusname[6] = 0;
|
||||
mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK);
|
||||
mapmusposition = mapheaderinfo[gamemap-1]->muspos;
|
||||
}
|
||||
if ((mapmusflags & MUSIC_RELOADRESET) && !(mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD || netgame))
|
||||
S_ReloadReset();
|
||||
|
||||
if (RESETMUSIC || reset)
|
||||
S_StopMusic();
|
||||
|
@ -2449,6 +2389,14 @@ void S_StartEx(boolean reset)
|
|||
music_stack_fadein = JINGLEPOSTFADE;
|
||||
}
|
||||
|
||||
void S_ReloadReset(void)
|
||||
{
|
||||
strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7);
|
||||
mapmusname[6] = 0;
|
||||
mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK);
|
||||
mapmusposition = mapheaderinfo[gamemap-1]->muspos;
|
||||
}
|
||||
|
||||
static void Command_Tunes_f(void)
|
||||
{
|
||||
const char *tunearg;
|
||||
|
@ -2524,7 +2472,7 @@ static void Command_RestartAudio_f(void)
|
|||
// These must be called or no sound and music until manually set.
|
||||
|
||||
I_SetSfxVolume(cv_soundvolume.value);
|
||||
S_SetMusicVolume(cv_digmusicvolume.value, cv_midimusicvolume.value);
|
||||
S_SetMusicVolume(-1);
|
||||
if (Playing()) // Gotta make sure the player is in a level
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
}
|
||||
|
@ -2548,85 +2496,37 @@ void GameSounds_OnChange(void)
|
|||
}
|
||||
}
|
||||
|
||||
void GameDigiMusic_OnChange(void)
|
||||
void GameMusic_OnChange(void)
|
||||
{
|
||||
if (M_CheckParm("-nomusic") || M_CheckParm("-noaudio"))
|
||||
return;
|
||||
else if (M_CheckParm("-nodigmusic"))
|
||||
return;
|
||||
|
||||
if (digital_disabled)
|
||||
if (music_disabled)
|
||||
{
|
||||
digital_disabled = false;
|
||||
music_disabled = false;
|
||||
I_StartupSound(); // will return early if initialised
|
||||
I_InitMusic();
|
||||
|
||||
if (Playing())
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
else if ((!cv_musicpref.value || midi_disabled) && S_DigExists("_clear"))
|
||||
else if (S_MusicPrefExists("_clear"))
|
||||
S_ChangeMusicInternal("_clear", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
digital_disabled = true;
|
||||
if (S_MusicType() != MU_MID && S_MusicType() != MU_MID_EX)
|
||||
{
|
||||
S_StopMusic();
|
||||
if (!midi_disabled)
|
||||
{
|
||||
if (Playing())
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
else
|
||||
S_ChangeMusicInternal("_clear", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameMIDIMusic_OnChange(void)
|
||||
{
|
||||
if (M_CheckParm("-nomusic") || M_CheckParm("-noaudio"))
|
||||
return;
|
||||
else if (M_CheckParm("-nomidimusic"))
|
||||
return;
|
||||
|
||||
if (midi_disabled)
|
||||
{
|
||||
midi_disabled = false;
|
||||
I_StartupSound(); // will return early if initialised
|
||||
I_InitMusic();
|
||||
|
||||
if (Playing())
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
else if ((cv_musicpref.value || digital_disabled) && S_MIDIExists("_clear"))
|
||||
S_ChangeMusicInternal("_clear", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
midi_disabled = true;
|
||||
if (S_MusicType() == MU_MID || S_MusicType() == MU_MID_EX)
|
||||
{
|
||||
S_StopMusic();
|
||||
if (!digital_disabled)
|
||||
{
|
||||
if (Playing())
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
else
|
||||
S_ChangeMusicInternal("_clear", false);
|
||||
}
|
||||
}
|
||||
music_disabled = true;
|
||||
S_StopMusic();
|
||||
}
|
||||
}
|
||||
|
||||
void MusicPref_OnChange(void)
|
||||
{
|
||||
if (M_CheckParm("-nomusic") || M_CheckParm("-noaudio") ||
|
||||
M_CheckParm("-nomidimusic") || M_CheckParm("-nodigmusic"))
|
||||
if (M_CheckParm("-nomusic") || M_CheckParm("-noaudio"))
|
||||
return;
|
||||
|
||||
if (Playing())
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
else if (S_PrefAvailable(cv_musicpref.value, "_clear"))
|
||||
else if (S_MusicPrefExists("_clear"))
|
||||
S_ChangeMusicInternal("_clear", false);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,18 +33,14 @@ extern consvar_t cv_soundvolume, cv_closedcaptioning, cv_digmusicvolume, cv_midi
|
|||
extern consvar_t cv_numChannels;
|
||||
|
||||
extern consvar_t cv_resetmusic;
|
||||
extern consvar_t cv_resetmusicbyheader;
|
||||
|
||||
extern consvar_t cv_1upsound;
|
||||
|
||||
#define RESETMUSIC (!modeattacking && \
|
||||
(cv_resetmusicbyheader.value ? \
|
||||
(mapheaderinfo[gamemap-1]->musforcereset != -1 ? mapheaderinfo[gamemap-1]->musforcereset : cv_resetmusic.value) \
|
||||
: cv_resetmusic.value) \
|
||||
mapheaderinfo[gamemap-1]->musforcereset != -1 ? mapheaderinfo[gamemap-1]->musforcereset : cv_resetmusic.value \
|
||||
)
|
||||
|
||||
extern consvar_t cv_gamedigimusic;
|
||||
extern consvar_t cv_gamemidimusic;
|
||||
extern consvar_t cv_gamesounds;
|
||||
extern consvar_t cv_musicpref;
|
||||
|
||||
|
@ -126,6 +122,7 @@ void S_InitSfxChannels(INT32 sfxVolume);
|
|||
void S_StopSounds(void);
|
||||
void S_ClearSfx(void);
|
||||
void S_StartEx(boolean reset);
|
||||
void S_ReloadReset(void);
|
||||
#define S_Start() S_StartEx(false)
|
||||
|
||||
//
|
||||
|
@ -154,23 +151,14 @@ void S_StopSound(void *origin);
|
|||
// Music Status
|
||||
//
|
||||
|
||||
boolean S_DigMusicDisabled(void);
|
||||
boolean S_MIDIMusicDisabled(void);
|
||||
boolean S_MusicDisabled(void);
|
||||
boolean S_MusicPlaying(void);
|
||||
boolean S_MusicPaused(void);
|
||||
boolean S_MusicNotInFocus(void);
|
||||
musictype_t S_MusicType(void);
|
||||
const char *S_MusicName(void);
|
||||
boolean S_MusicPrefExists(const char *mname);
|
||||
boolean S_MusicExists(const char *mname, boolean checkMIDI, boolean checkDigi);
|
||||
#define S_DigExists(a) S_MusicExists(a, false, true)
|
||||
#define S_MIDIExists(a) S_MusicExists(a, true, false)
|
||||
|
||||
// Returns whether the preferred format a (true = MIDI, false = Digital)
|
||||
// exists and is enabled for musicname b
|
||||
#define S_PrefAvailable(a, b) (a ? \
|
||||
(!S_MIDIMusicDisabled() && S_MIDIExists(b)) : \
|
||||
(!S_DigMusicDisabled() && S_DigExists(b)))
|
||||
|
||||
//
|
||||
// Music Effects
|
||||
|
@ -310,10 +298,7 @@ void S_UpdateClosedCaptions(void);
|
|||
FUNCMATH fixed_t S_CalculateSoundDistance(fixed_t px1, fixed_t py1, fixed_t pz1, fixed_t px2, fixed_t py2, fixed_t pz2);
|
||||
|
||||
void S_SetSfxVolume(INT32 volume);
|
||||
void S_SetMusicVolume(INT32 digvolume, INT32 seqvolume);
|
||||
#define S_SetDigMusicVolume(a) S_SetMusicVolume(a,-1)
|
||||
#define S_SetMIDIMusicVolume(a) S_SetMusicVolume(-1,a)
|
||||
#define S_InitMusicVolume() S_SetMusicVolume(-1,-1)
|
||||
void S_SetMusicVolume(INT32 volume);
|
||||
|
||||
INT32 S_OriginPlaying(void *origin);
|
||||
INT32 S_IdPlaying(sfxenum_t id);
|
||||
|
|
|
@ -95,7 +95,6 @@ UINT8 sound_started = false;
|
|||
static Mix_Music *music;
|
||||
static UINT8 music_volume, sfx_volume, internal_volume;
|
||||
static float loop_point;
|
||||
static float song_length; // length in seconds
|
||||
static boolean songpaused;
|
||||
static UINT32 music_bytes;
|
||||
static boolean is_looping;
|
||||
|
@ -218,7 +217,7 @@ consvar_t cv_miditimiditypath = CVAR_INIT ("midisoundbank", "./timidity", CV_SAV
|
|||
|
||||
static void var_cleanup(void)
|
||||
{
|
||||
song_length = loop_point = 0.0f;
|
||||
loop_point = 0.0f;
|
||||
music_bytes = fading_source = fading_target =\
|
||||
fading_timer = fading_duration = 0;
|
||||
|
||||
|
@ -919,9 +918,9 @@ boolean I_SetSongSpeed(float speed)
|
|||
|
||||
UINT32 I_GetSongLength(void)
|
||||
{
|
||||
#ifdef HAVE_GME
|
||||
INT32 length;
|
||||
|
||||
#ifdef HAVE_GME
|
||||
if (gme)
|
||||
{
|
||||
gme_info_t *info;
|
||||
|
@ -969,12 +968,7 @@ UINT32 I_GetSongLength(void)
|
|||
if (xlength >= 0)
|
||||
return (UINT32)(xlength*1000);
|
||||
#endif
|
||||
// VERY IMPORTANT to set your LENGTHMS= in your song files, folks!
|
||||
// SDL mixer can't read music length itself.
|
||||
length = (UINT32)(song_length*1000);
|
||||
if (!length)
|
||||
CONS_Debug(DBG_DETAILED, "Getting music length: music is missing LENGTHMS= tag. Needed for seeking.\n");
|
||||
return length;
|
||||
return 0; //used to check for LENGTHMS, but that's now gone
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1272,7 +1266,6 @@ boolean I_LoadSong(char *data, size_t len)
|
|||
|
||||
// Find the OGG loop point.
|
||||
loop_point = 0.0f;
|
||||
song_length = 0.0f;
|
||||
|
||||
while ((UINT32)(p - data) < len)
|
||||
{
|
||||
|
@ -1363,9 +1356,6 @@ boolean I_PlaySong(boolean looping)
|
|||
if (!music)
|
||||
return false;
|
||||
|
||||
if (fpclassify(song_length) == FP_ZERO && (I_SongType() == MU_OGG || I_SongType() == MU_MP3 || I_SongType() == MU_FLAC))
|
||||
CONS_Debug(DBG_DETAILED, "This song is missing a LENGTHMS= tag! Required to make seeking work properly.\n");
|
||||
|
||||
if (I_SongType() != MU_MOD && I_SongType() != MU_MID && Mix_PlayMusic(music, 0) == -1)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "Mix_PlayMusic: %s\n", Mix_GetError());
|
||||
|
|
|
@ -196,7 +196,7 @@ static void Snd_LockAudio(void) //Alam: Lock audio data and uninstall audio call
|
|||
{
|
||||
if (Snd_Mutex) SDL_LockMutex(Snd_Mutex);
|
||||
else if (sound_disabled) return;
|
||||
else if (midi_disabled && digital_disabled
|
||||
else if (music_disabled
|
||||
#ifdef HW3SOUND
|
||||
&& hws_mode == HWS_DEFAULT_MODE
|
||||
#endif
|
||||
|
@ -210,7 +210,7 @@ static void Snd_UnlockAudio(void) //Alam: Unlock audio data and reinstall audio
|
|||
{
|
||||
if (Snd_Mutex) SDL_UnlockMutex(Snd_Mutex);
|
||||
else if (sound_disabled) return;
|
||||
else if (midi_disabled && digital_disabled
|
||||
else if (music_disabled
|
||||
#ifdef HW3SOUND
|
||||
&& hws_mode == HWS_DEFAULT_MODE
|
||||
#endif
|
||||
|
@ -1154,7 +1154,7 @@ void I_ShutdownSound(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (midi_disabled && digital_disabled)
|
||||
if (music_disabled)
|
||||
SDL_CloseAudio();
|
||||
CONS_Printf("%s", M_GetText("shut down\n"));
|
||||
sound_started = false;
|
||||
|
@ -1174,7 +1174,7 @@ void I_StartupSound(void)
|
|||
const char *sdrv_name = NULL;
|
||||
#endif
|
||||
#ifndef HAVE_MIXER
|
||||
midi_disabled = digital_disabled = true;
|
||||
music_disabled = true;
|
||||
#endif
|
||||
|
||||
memset(channels, 0, sizeof (channels)); //Alam: Clean it
|
||||
|
|
|
@ -1050,7 +1050,7 @@ void Y_Ticker(void)
|
|||
#endif
|
||||
)
|
||||
S_FadeOutStopMusic(mapheaderinfo[gamemap-1]->musinterfadeout);
|
||||
else if (mapheaderinfo[gamemap-1]->musintername[0] && S_MusicExists(mapheaderinfo[gamemap-1]->musintername, !midi_disabled, !digital_disabled))
|
||||
else if (mapheaderinfo[gamemap-1]->musintername[0] && S_MusicPrefExists(mapheaderinfo[gamemap-1]->musintername))
|
||||
S_ChangeMusicInternal(mapheaderinfo[gamemap-1]->musintername, false); // don't loop it
|
||||
else
|
||||
S_ChangeMusicInternal("_clear", false); // don't loop it
|
||||
|
@ -1127,7 +1127,7 @@ void Y_Ticker(void)
|
|||
#endif
|
||||
)
|
||||
S_FadeOutStopMusic(mapheaderinfo[gamemap-1]->musinterfadeout);
|
||||
else if (mapheaderinfo[gamemap-1]->musintername[0] && S_MusicExists(mapheaderinfo[gamemap-1]->musintername, !midi_disabled, !digital_disabled))
|
||||
else if (mapheaderinfo[gamemap-1]->musintername[0] && S_MusicPrefExists(mapheaderinfo[gamemap-1]->musintername))
|
||||
S_ChangeMusicInternal(mapheaderinfo[gamemap-1]->musintername, false); // don't loop it
|
||||
else
|
||||
S_ChangeMusicInternal(stagefailed ? "CHFAIL" : "CHPASS", false); // don't loop it
|
||||
|
|
Loading…
Reference in a new issue