From ef08db8d897b7cd16a6d5af1f0ce9984ee8e1910 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 20 Jan 2024 13:58:11 +0100 Subject: [PATCH 1/9] fix issues with sound precaching adds a check if sounds have been previously loaded already also makes it useful at all by not freeing soundsfx data on each mapload when its enabled also adds an onchange so toggling it either caches all sounds again or frees them --- src/p_setup.c | 6 +++++- src/s_sound.c | 22 ++++++++++++++++++---- src/s_sound.h | 1 + 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 7b4a3db2b..0b3ab35bf 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2936,7 +2936,11 @@ boolean P_SetupLevel(boolean skipprecip) // Make sure all sounds are stopped before Z_FreeTags. S_StopSounds(); - S_ClearSfx(); + + if ((!(!sound_disabled && (M_CheckParm("-precachesound")))) || (!precachesound.value)) //why do this with soundprecaching enabled?????? + { + S_ClearSfx(); + } // As oddly named as this is, this handles music only. // We should be fine starting it here. diff --git a/src/s_sound.c b/src/s_sound.c index 4be55a8a0..81572ec94 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -53,6 +53,7 @@ static void Command_ShowMusicCredit_f(void); static void GameMIDIMusic_OnChange(void); #endif static void GameSounds_OnChange(void); +static void SoundPrecache_OnChange(void); static void GameDigiMusic_OnChange(void); static void BufferSize_OnChange(void); @@ -74,7 +75,7 @@ consvar_t cv_audbuffersize = {"buffersize", "2048", CV_SAVE, audbuffersize_cons_ consvar_t stereoreverse = {"stereoreverse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // if true, all sounds are loaded at game startup -static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t precachesound = {"precachesound", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, SoundPrecache_OnChange, 0, NULL, NULL, 0, 0, NULL}; // actual general (maximum) sound & music volume, saved into the config consvar_t cv_soundvolume = {"soundvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -1269,9 +1270,9 @@ void S_InitSfxChannels(INT32 sfxVolume) // Initialize external data (all sounds) at start, keep static. CONS_Printf(M_GetText("Loading sounds... ")); - for (i = 1; i < NUMSFX; i++) - if (S_sfx[i].name) - S_sfx[i].data = I_GetSfx(&S_sfx[i]); + for (i = 1; i < NUMSFX; i++) + if (S_sfx[i].name && !S_sfx[i].data) + S_sfx[i].data = I_GetSfx(&S_sfx[i]); CONS_Printf(M_GetText(" pre-cached all sound data\n")); } @@ -2388,6 +2389,19 @@ void GameSounds_OnChange(void) } } +static void SoundPrecache_OnChange(void) +{ + if ((precachesound.value) && (!sound_disabled)) + { + S_InitSfxChannels(cv_soundvolume.value); + } + else if (!precachesound.value) + { + S_ClearSfx(); + if (!sound_disabled) + S_InitSfxChannels(cv_soundvolume.value); + } +} void GameDigiMusic_OnChange(void) { diff --git a/src/s_sound.h b/src/s_sound.h index 72d4bd38d..d974079a4 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -69,6 +69,7 @@ extern consvar_t cv_resume; extern consvar_t cv_fading; extern consvar_t cv_birdmusic; +extern consvar_t precachesound; extern CV_PossibleValue_t soundvolume_cons_t[]; From 442c8e59a1ee6e766616e1e7462203d270860c75 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 20 Jan 2024 15:39:25 +0100 Subject: [PATCH 2/9] make sound precaching useful at all so it also precaches addon sounds and all thx indev for help <3 --- src/p_setup.c | 2 +- src/s_sound.c | 6 +++++- src/sounds.c | 9 ++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 0b3ab35bf..d6c93ea5b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2937,7 +2937,7 @@ boolean P_SetupLevel(boolean skipprecip) // Make sure all sounds are stopped before Z_FreeTags. S_StopSounds(); - if ((!(!sound_disabled && (M_CheckParm("-precachesound")))) || (!precachesound.value)) //why do this with soundprecaching enabled?????? + if (!(M_CheckParm("-precachesound") || precachesound.value)) //why do this with soundprecaching enabled?????? { S_ClearSfx(); } diff --git a/src/s_sound.c b/src/s_sound.c index 81572ec94..fd08f32fb 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1270,10 +1270,14 @@ void S_InitSfxChannels(INT32 sfxVolume) // Initialize external data (all sounds) at start, keep static. CONS_Printf(M_GetText("Loading sounds... ")); - for (i = 1; i < NUMSFX; i++) + for (i = 1; i < sfx_freeslot0; i++) if (S_sfx[i].name && !S_sfx[i].data) S_sfx[i].data = I_GetSfx(&S_sfx[i]); + for (i = sfx_freeslot0; i < NUMSFX; i++) + if (S_sfx[i].priority && !S_sfx[i].data) + S_sfx[i].data = I_GetSfx(&S_sfx[i]); + CONS_Printf(M_GetText(" pre-cached all sound data\n")); } } diff --git a/src/sounds.c b/src/sounds.c index d949c27ab..e815d0554 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -14,6 +14,8 @@ #include "doomtype.h" #include "i_sound.h" #include "sounds.h" +#include "s_sound.h" //for soundprecaching +#include "m_argv.h" #include "r_defs.h" #include "r_things.h" #include "z_zone.h" @@ -1032,7 +1034,12 @@ sfxenum_t S_AddSoundFx(const char *name, boolean singular, INT32 flags, boolean S_sfx[i].usefulness = -1; /// \todo if precached load it here - S_sfx[i].data = NULL; + if (!sound_disabled && (M_CheckParm("-precachesound") || precachesound.value)){ + CONS_Printf("Precaching sounds...\n"); + S_sfx[i].data = I_GetSfx(&S_sfx[i]); + } + else + S_sfx[i].data = NULL; return i; } } From 8d43f6144aa0c1fd28670e967857943fd46a5d38 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 20 Jan 2024 15:43:42 +0100 Subject: [PATCH 3/9] make some things static + remove cdmusic leftovers --- src/android/i_cdmus.c | 37 ------------------------------------- src/dummy/i_cdmus.c | 38 -------------------------------------- src/s_sound.c | 4 ++-- src/s_sound.h | 3 --- 4 files changed, 2 insertions(+), 80 deletions(-) delete mode 100644 src/android/i_cdmus.c delete mode 100644 src/dummy/i_cdmus.c diff --git a/src/android/i_cdmus.c b/src/android/i_cdmus.c deleted file mode 100644 index 426bc5dc9..000000000 --- a/src/android/i_cdmus.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "../command.h" -#include "../s_sound.h" -#include "../i_sound.h" - -// -// CD MUSIC I/O -// - -UINT8 cdaudio_started = 0; - -consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; - - -void I_InitCD(void){} - -void I_StopCD(void){} - -void I_PauseCD(void){} - -void I_ResumeCD(void){} - -void I_ShutdownCD(void){} - -void I_UpdateCD(void){} - -void I_PlayCD(UINT8 track, UINT8 looping) -{ - (void)track; - (void)looping; -} - -boolean I_SetVolumeCD(INT32 volume) -{ - (void)volume; - return false; -} diff --git a/src/dummy/i_cdmus.c b/src/dummy/i_cdmus.c deleted file mode 100644 index fc35eb9cf..000000000 --- a/src/dummy/i_cdmus.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "../command.h" -#include "../s_sound.h" -#include "../i_sound.h" - -// -// CD MUSIC I/O -// - -UINT8 cdaudio_started = 0; - -consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; - - -void I_InitCD(void){} - -void I_StopCD(void){} - -void I_PauseCD(void){} - -void I_ResumeCD(void){} - -void I_ShutdownCD(void){} - -void I_UpdateCD(void){} - -void I_PlayCD(UINT8 track, UINT8 looping) -{ - (void)track; - (void)looping; -} - -boolean I_SetVolumeCD(int volume) -{ - (void)volume; - return false; -} - diff --git a/src/s_sound.c b/src/s_sound.c index fd08f32fb..e3744df6a 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -41,7 +41,6 @@ static boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *vol, INT32 *sep, INT32 *pitch, sfxinfo_t *sfxinfo); #endif -CV_PossibleValue_t soundvolume_cons_t[] = {{0, "MIN"}, {31, "MAX"}, {0, NULL}}; static void SetChannelsNum(void); static void Command_Tunes_f(void); static void Command_RestartAudio_f(void); @@ -78,6 +77,7 @@ consvar_t stereoreverse = {"stereoreverse", "Off", CV_SAVE, CV_OnOff, NULL, 0, N consvar_t precachesound = {"precachesound", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, SoundPrecache_OnChange, 0, NULL, NULL, 0, 0, NULL}; // actual general (maximum) sound & music volume, saved into the config +static CV_PossibleValue_t soundvolume_cons_t[] = {{0, "MIN"}, {31, "MAX"}, {0, NULL}}; consvar_t cv_soundvolume = {"soundvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; #ifndef NO_MIDI @@ -2374,7 +2374,7 @@ static void Command_ShowMusicCredit_f(void) } } -void GameSounds_OnChange(void) +static void GameSounds_OnChange(void) { if (M_CheckParm("-nosound") || M_CheckParm("-noaudio")) return; diff --git a/src/s_sound.h b/src/s_sound.h index d974079a4..c6745bea6 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -71,8 +71,6 @@ extern consvar_t cv_birdmusic; extern consvar_t precachesound; -extern CV_PossibleValue_t soundvolume_cons_t[]; - typedef enum { SF_TOTALLYSINGLE = 1, // Only play one of these sounds at a time...GLOBALLY @@ -120,7 +118,6 @@ lumpnum_t S_GetSfxLumpNum(sfxinfo_t *sfx); boolean S_SoundDisabled(void); - // // Start sound for thing at using from sounds.h // From f41d7e9e97bdd405eb8302ae24e90a4d6d947b8b Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 20 Jan 2024 16:52:46 +0100 Subject: [PATCH 4/9] make NO_MIDI=0 compile --- src/s_sound.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s_sound.h b/src/s_sound.h index c6745bea6..aa4b2b28f 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -37,7 +37,7 @@ extern consvar_t cv_audbuffersize; //extern consvar_t cv_resetmusic; extern consvar_t cv_gamedigimusic; #ifndef NO_MIDI -extern consvar_t cv_gamemidimusic; +extern consvar_t cv_gamemidimusic, cv_midimusicvolume; #endif extern consvar_t cv_gamesounds; extern consvar_t cv_playmusicifunfocused; From db5ada9fa03db5cc76e19da608cfd799e41230e9 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 20 Jan 2024 17:01:48 +0100 Subject: [PATCH 5/9] cleanup s_sound a little + fix onchanges --- src/s_sound.c | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index e3744df6a..fb8b74820 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2055,8 +2055,7 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32 } } -void -S_ChangeMusicSpecial (const char *mmusic) +void S_ChangeMusicSpecial (const char *mmusic) { if (cv_resetspecialmusic.value) S_ChangeMusic(mmusic, MUSIC_FORCERESET, true); @@ -2143,14 +2142,12 @@ void S_SetMusicVolume(INT32 digvolume, INT32 seqvolume) } } -void -S_SetRestoreMusicFadeInCvar (consvar_t *cv) +void S_SetRestoreMusicFadeInCvar (consvar_t *cv) { music_refade_cv = cv; } -int -S_GetRestoreMusicFadeIn (void) +int S_GetRestoreMusicFadeIn (void) { if (music_refade_cv && cv_fading.value) return music_refade_cv->value; @@ -2158,15 +2155,13 @@ S_GetRestoreMusicFadeIn (void) return 0; } -void -S_SetMusicUsage (int type) +void S_SetMusicUsage (int type) { music_usage = type; I_UpdateSongLagConditions(); } -int -S_MusicUsage (void) +int S_MusicUsage (void) { return music_usage; } @@ -2379,14 +2374,14 @@ static void GameSounds_OnChange(void) if (M_CheckParm("-nosound") || M_CheckParm("-noaudio")) return; - if (sound_disabled) + if (sound_disabled && !cv_gamesounds.value) { sound_disabled = false; I_StartupSound(); // will return early if initialised S_InitSfxChannels(cv_soundvolume.value); S_StartSound(NULL, sfx_strpst); } - else + else if (!sound_disabled && cv_gamesounds.value) { sound_disabled = true; S_StopSounds(); @@ -2407,14 +2402,14 @@ static void SoundPrecache_OnChange(void) } } -void GameDigiMusic_OnChange(void) +static void GameDigiMusic_OnChange(void) { if (M_CheckParm("-nomusic") || M_CheckParm("-noaudio")) return; else if (M_CheckParm("-nodigmusic")) return; - if (digital_disabled) + if (digital_disabled && !cv_gamedigimusic.value) { digital_disabled = false; I_StartupSound(); // will return early if initialised @@ -2425,7 +2420,7 @@ void GameDigiMusic_OnChange(void) else S_ChangeMusicInternal("titles", looptitle); } - else + else if (!digital_disabled && cv_gamedigimusic.value) { digital_disabled = true; if (S_MusicType() != MU_MID) @@ -2452,21 +2447,21 @@ void GameDigiMusic_OnChange(void) #ifdef HAVE_OPENMPT -void ModFilter_OnChange(void) +static void ModFilter_OnChange(void) { if (openmpt_mhandle) openmpt_module_set_render_param(openmpt_mhandle, OPENMPT_MODULE_RENDER_INTERPOLATIONFILTER_LENGTH, cv_modfilter.value); } -void StereoSep_OnChange(void) +static void StereoSep_OnChange(void) { if (openmpt_mhandle) openmpt_module_set_render_param(openmpt_mhandle, OPENMPT_MODULE_RENDER_STEREOSEPARATION_PERCENT, cv_stereosep.value); } -void AmigaFilter_OnChange(void) +static void AmigaFilter_OnChange(void) { if (openmpt_mhandle) openmpt_module_ctl_set(openmpt_mhandle, "render.resampler.emulate_amiga", cv_amigafilter.value ? "1" : "0"); @@ -2474,7 +2469,7 @@ void AmigaFilter_OnChange(void) #if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 -void AmigaType_OnChange(void) +static void AmigaType_OnChange(void) { if (openmpt_mhandle) openmpt_module_ctl_set_text(openmpt_mhandle, "render.resampler.emulate_amiga_type", cv_amigatype.string); @@ -2485,21 +2480,21 @@ void AmigaType_OnChange(void) #endif #endif -void BufferSize_OnChange(void) +static void BufferSize_OnChange(void) { if (sound_started) COM_ImmedExecute("restartaudio"); } #ifndef NO_MIDI -void GameMIDIMusic_OnChange(void) +static void GameMIDIMusic_OnChange(void) { if (M_CheckParm("-nomusic") || M_CheckParm("-noaudio")) return; else if (M_CheckParm("-nomidimusic")) return; - if (midi_disabled) + if (midi_disabled && !cv_gamemidimusic.value) { midi_disabled = false; I_InitMusic(); @@ -2508,7 +2503,7 @@ void GameMIDIMusic_OnChange(void) else S_ChangeMusicInternal("titles", looptitle); } - else + else if (midi_disabled && !cv_gamemidimusic.value) { midi_disabled = true; if (S_MusicType() == MU_MID) From 193248b71c297f3b1a4b65e2fb2ca5dbabc8238f Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 20 Jan 2024 17:03:05 +0100 Subject: [PATCH 6/9] oops --- src/s_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s_sound.c b/src/s_sound.c index fb8b74820..d11033b53 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2503,7 +2503,7 @@ static void GameMIDIMusic_OnChange(void) else S_ChangeMusicInternal("titles", looptitle); } - else if (midi_disabled && !cv_gamemidimusic.value) + else if (!midi_disabled && cv_gamemidimusic.value) { midi_disabled = true; if (S_MusicType() == MU_MID) From 7dfad132dd9dbac5c942df319ac7f4e255b56bdf Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 20 Jan 2024 17:24:11 +0100 Subject: [PATCH 7/9] grr --- src/s_sound.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index d11033b53..1fdfb790a 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -83,6 +83,7 @@ consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons #ifndef NO_MIDI consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif + // number of channels available consvar_t cv_numChannels = {"snd_channels", "64", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL}; @@ -121,7 +122,6 @@ consvar_t cv_resume = {"resume", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0 consvar_t cv_fading = {"fading", "Off", CV_SAVE|CV_CALL, CV_OnOff, Bird_menu_Onchange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_birdmusic = {"birdmusicstuff", "No", CV_SAVE|CV_CALL, CV_YesNo, Bird_menu_Onchange, 0, NULL, NULL, 0, 0, NULL}; - #ifdef HAVE_OPENMPT openmpt_module *openmpt_mhandle = NULL; @@ -138,7 +138,6 @@ consvar_t cv_amigafilter = {"amigafilter", "1", CV_SAVE|CV_CALL, amigafilter_con static CV_PossibleValue_t amigatype_cons_t[] = {{0, "auto"}, {1, "a500"}, {2, "a1200"}, {0, NULL}}; consvar_t cv_amigatype = {"amigatype", "0", CV_SAVE|CV_CALL|CV_NOINIT, amigatype_cons_t, AmigaType_OnChange, 0, NULL, NULL, 0, 0, NULL}; #endif - #endif #define S_MAX_VOLUME 127 @@ -345,7 +344,6 @@ static void SetChannelsNum(void) channels[i].sfxinfo = 0; } - // Retrieve the lump number of sfx // lumpnum_t S_GetSfxLumpNum(sfxinfo_t *sfx) @@ -380,7 +378,6 @@ boolean S_SoundDisabled(void) ); } - // Stop all sounds, load level info, THEN start sounds. void S_StopSounds(void) { @@ -461,7 +458,6 @@ static INT32 S_ScaleVolumeWithSplitscreen(INT32 volume) ) / FRACUNIT; } - void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) { const mobj_t *origin = (const mobj_t *)origin_p; @@ -1673,6 +1669,7 @@ void S_InitMTDefs(void) for (i = 0; i < numwadfiles; i++) S_LoadMTDefs(i); } + // // S_FindMusicCredit // @@ -1768,7 +1765,6 @@ boolean S_PrepareSoundTest(void) return true; } - /// ------------------------ /// Music Status /// ------------------------ From b79a05f25b52e3c5cf5704d151d043d90ae52bc2 Mon Sep 17 00:00:00 2001 From: Indev Date: Sun, 21 Jan 2024 17:44:51 +0300 Subject: [PATCH 8/9] Fix freeing sounds that aren't actually replaced --- src/p_setup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/p_setup.c b/src/p_setup.c index d6c93ea5b..010a28fd3 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3508,11 +3508,12 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local) for (i = 0; i < numlumps; i++, lumpinfo++) { name = lumpinfo->name; + lumpnum_t lumpnum = i|(wadnum<<16); if (name[0] == 'D') { if (name[1] == 'S') for (j = 1; j < NUMSFX; j++) { - if (S_sfx[j].name && !strnicmp(S_sfx[j].name, name + 2, 6)) + if (S_sfx[j].name && !strnicmp(S_sfx[j].name, name + 2, 6) && S_sfx[j].lumpnum != lumpnum && S_sfx[j].lumpnum != LUMPERROR) { // the sound will be reloaded when needed, // since sfx->data will be NULL @@ -3520,6 +3521,10 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local) I_FreeSfx(&S_sfx[j]); + // Re-cache it + if (!sound_disabled && (M_CheckParm("-precachesound") || precachesound.value)) + S_sfx[j].data = I_GetSfx(&S_sfx[j]); + sreplaces++; } } From 7984f57b737b88b714b3644ef7ba62815b92206e Mon Sep 17 00:00:00 2001 From: Indev Date: Sun, 21 Jan 2024 17:45:09 +0300 Subject: [PATCH 9/9] Remove debug print --- src/sounds.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/sounds.c b/src/sounds.c index e815d0554..a69eb744d 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1033,9 +1033,7 @@ sfxenum_t S_AddSoundFx(const char *name, boolean singular, INT32 flags, boolean S_sfx[i].skinsound = -1; S_sfx[i].usefulness = -1; - /// \todo if precached load it here if (!sound_disabled && (M_CheckParm("-precachesound") || precachesound.value)){ - CONS_Printf("Precaching sounds...\n"); S_sfx[i].data = I_GetSfx(&S_sfx[i]); } else