From 6571c78ed4937316f2495bb2a879f2f69397abcc Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 31 Oct 2021 21:06:54 +0600 Subject: [PATCH] engine: client: hide late precache warning under s_warn_late_precache cvar This warn is valid mostly for multiplayer games. In singleplayer games, this is a false-positive as sentences are hot loaded --- engine/client/s_load.c | 2 +- engine/client/s_main.c | 1 + engine/client/sound.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/client/s_load.c b/engine/client/s_load.c index 10144c4a..da657038 100644 --- a/engine/client/s_load.c +++ b/engine/client/s_load.c @@ -141,7 +141,7 @@ wavdata_t *S_LoadSound( sfx_t *sfx ) if( Q_stricmp( sfx->name, "*default" )) { // load it from disk - if( host_developer.value > 0 && CL_Active() ) + if( s_warn_late_precache.value > 0 && CL_Active() ) Con_Printf( S_WARN "S_LoadSound: late precache of %s\n", sfx->name ); if( sfx->name[0] == '*' ) diff --git a/engine/client/s_main.c b/engine/client/s_main.c index a23a3943..9214e2c0 100644 --- a/engine/client/s_main.c +++ b/engine/client/s_main.c @@ -46,6 +46,7 @@ static CVAR_DEFINE_AUTO( s_combine_sounds, "0", FCVAR_ARCHIVE, "combine channels CVAR_DEFINE_AUTO( snd_mute_losefocus, "1", FCVAR_ARCHIVE, "silence the audio when game window loses focus" ); CVAR_DEFINE_AUTO( s_test, "0", 0, "engine developer cvar for quick testing new features" ); CVAR_DEFINE_AUTO( s_samplecount, "0", FCVAR_ARCHIVE, "sample count (0 for default value)" ); +CVAR_DEFINE_AUTO( s_warn_late_precache, "0", FCVAR_ARCHIVE, "warn about late precached sounds on client-side" ); /* ============================================================================= diff --git a/engine/client/sound.h b/engine/client/sound.h index a955882c..930d114d 100644 --- a/engine/client/sound.h +++ b/engine/client/sound.h @@ -222,6 +222,7 @@ extern convar_t *dsp_off; extern convar_t s_test; // cvar to testify new effects extern convar_t s_samplecount; extern convar_t snd_mute_losefocus; +extern convar_t s_warn_late_precache; void S_InitScaletable( void ); wavdata_t *S_LoadSound( sfx_t *sfx );