i hate this so i just make it a boolean

confused the heck outta me so just do it like this lmao
This commit is contained in:
Alug committed 2024-01-21 15:31:07 +01:00
1 parent 4b09e92d7c
commit 6782876c0c
4 files changed
+17 -10

No files matched your search

+2 -4
View File
@@ -2937,11 +2937,9 @@ boolean P_SetupLevel(boolean skipprecip)
// Make sure all sounds are stopped before Z_FreeTags.
S_StopSounds();
if (!(M_CheckParm("-precachesound") || precachesound.value)) //why do this with soundprecaching enabled??????
{
if (!S_PrecacheSound())
S_ClearSfx();
}
// As oddly named as this is, this handles music only.
// We should be fine starting it here.
+13 -4
View File
@@ -378,6 +378,15 @@ boolean S_SoundDisabled(void)
);
}
boolean S_PrecacheSound(void)
{
if (!sound_disabled && (M_CheckParm("-precachesound")))
return true;
if (!sound_disabled && precachesound.value)
return true;
return false;
}
// Stop all sounds, load level info, THEN start sounds.
void S_StopSounds(void)
{
@@ -1260,8 +1269,8 @@ void S_InitSfxChannels(INT32 sfxVolume)
S_sfx[i].lumpnum = LUMPERROR;
}
// precache sounds if requested by cmdline, or precachesound var true
if (!sound_disabled && (M_CheckParm("-precachesound") || precachesound.value))
// Precache sounds if requested
if (S_PrecacheSound())
{
// Initialize external data (all sounds) at start, keep static.
CONS_Printf(M_GetText("Loading sounds... "));
@@ -2387,11 +2396,11 @@ static void GameSounds_OnChange(void)
static void SoundPrecache_OnChange(void)
{
if ((precachesound.value) && (!sound_disabled))
if (S_PrecacheSound())
{
S_InitSfxChannels(cv_soundvolume.value);
}
else if (!precachesound.value)
else if (!S_PrecacheSound())
{
S_ClearSfx();
if (!sound_disabled)
+1 -1
View File
@@ -139,6 +139,7 @@ boolean S_MusicDisabled(void);
boolean S_MusicPlaying(void);
boolean S_MusicPaused(void);
boolean S_MusicNotInFocus(void);
boolean S_PrecacheSound(void);
musictype_t S_MusicType(void);
const char *S_MusicName(void);
boolean S_MusicInfo(char *mname, UINT16 *mflags, boolean *looping);
@@ -247,7 +248,6 @@ void S_StopMusic(void);
void S_PauseAudio(void);
void S_ResumeAudio(void);
//
// Music Fading
//
+1 -1
View File
@@ -1034,7 +1034,7 @@ sfxenum_t S_AddSoundFx(const char *name, boolean singular, INT32 flags, boolean
S_sfx[i].usefulness = -1;
/// \todo if precached load it here
if (!sound_disabled && (M_CheckParm("-precachesound") || precachesound.value)){
if (S_PrecacheSound()){
CONS_Printf("Precaching sounds...\n");
S_sfx[i].data = I_GetSfx(&S_sfx[i]);
}