From 065f86391eb803db1d2253e407dd5c7049273f25 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 23 Apr 2024 00:15:02 +0200 Subject: [PATCH] Miles: put event queue warnings behind a cvar These warnings can get verbose, especially if events from the map itself are missing. Put behind a cvar and enabled it by default in development configurations. --- src/codecs/miles/miles_impl.cpp | 15 ++++++++++----- src/resource/cfg/system/autoexec_client_dev.cfg | 6 ++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/codecs/miles/miles_impl.cpp b/src/codecs/miles/miles_impl.cpp index 9de48fa9..3ee18c3c 100644 --- a/src/codecs/miles/miles_impl.cpp +++ b/src/codecs/miles/miles_impl.cpp @@ -6,6 +6,7 @@ #include "filesystem/filesystem.h" static ConVar miles_debug("miles_debug", "0", FCVAR_RELEASE, "Enables debug prints for the Miles Sound System", "1 = print; 0 (zero) = no print"); +static ConVar miles_warnings("miles_warnings", "0", FCVAR_RELEASE, "Enables warning prints for the Miles Sound System", "1 = print; 0 (zero) = no print"); //----------------------------------------------------------------------------- // Purpose: logs debug output emitted from the Miles Sound System @@ -40,7 +41,8 @@ bool Miles_Initialize() // if we are loading english and the file is still not found, we can let it hit the regular engine error, since that is not recoverable if (!FileSystem()->FileExists(baseStreamFilePath.c_str())) { - Error(eDLL_T::AUDIO, NO_ERROR, "%s: attempted to load language '%s' but the required streaming source file (%s) was not found. falling back to english...\n", __FUNCTION__, pszLanguage, baseStreamFilePath.c_str()); + Error(eDLL_T::AUDIO, NO_ERROR, "%s: attempted to load language '%s' but the required streaming source file (%s) was not found. falling back to '%s'...\n", + __FUNCTION__, pszLanguage, baseStreamFilePath.c_str(), MILES_DEFAULT_LANGUAGE); pszLanguage = MILES_DEFAULT_LANGUAGE; miles_language->SetValue(pszLanguage); @@ -99,11 +101,14 @@ void CSOM_AddEventToQueue(const char* eventName) v_CSOM_AddEventToQueue(eventName); - if (g_milesGlobals->queuedEventHash == 1) - Warning(eDLL_T::AUDIO, "%s: failed to add event to queue; invalid event name '%s'\n", __FUNCTION__, eventName); + if (miles_warnings.GetBool()) + { + if (g_milesGlobals->queuedEventHash == 1) + Warning(eDLL_T::AUDIO, "%s: failed to add event to queue; invalid event name '%s'\n", __FUNCTION__, eventName); - if (g_milesGlobals->queuedEventHash == 2) - Warning(eDLL_T::AUDIO, "%s: failed to add event to queue; event '%s' not found.\n", __FUNCTION__, eventName); + if (g_milesGlobals->queuedEventHash == 2) + Warning(eDLL_T::AUDIO, "%s: failed to add event to queue; event '%s' not found.\n", __FUNCTION__, eventName); + } }; diff --git a/src/resource/cfg/system/autoexec_client_dev.cfg b/src/resource/cfg/system/autoexec_client_dev.cfg index 652de307..978e9f1d 100644 --- a/src/resource/cfg/system/autoexec_client_dev.cfg +++ b/src/resource/cfg/system/autoexec_client_dev.cfg @@ -72,3 +72,9 @@ cl_ent_absbox "1" // Display entity abs bo gl_clear_color_buffer "1" // Enable or disable the clearing of the main color buffer. //mat_sync_rt "1" // Enable to debug render threads more easily ( !slower! ). //mat_sync_rt_flushes_gpu "1" // Enable to debug render threads more easily ( !slower! ). + +////////////////////////// +//// SOUND //// +////////////////////////// +//miles_debug "1" // Enable miles debug ( !slower! ). +miles_warnings "1" // Enable miles warnings.