From eaff488dc2d2df5dbd578a5d8474617999e0dfcc Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Tue, 27 Apr 2021 12:53:21 +0200 Subject: [PATCH] Client: Add an OSD for various EFX debug info when s_al_debug is enabled. --- src/client/efx.h | 2 ++ src/client/efx.qc | 39 +++++++++++++++++++++++++++++++++++++++ src/client/entry.qc | 4 ++++ 3 files changed, 45 insertions(+) diff --git a/src/client/efx.h b/src/client/efx.h index 3859eaaa..007fd53d 100644 --- a/src/client/efx.h +++ b/src/client/efx.h @@ -19,6 +19,8 @@ string *g_efx_name; int g_efx_count; var int autocvar_s_al_use_reverb = TRUE; +var int autocvar_s_al_debug = FALSE; + reverbinfo_t mix; int g_iEFX; diff --git a/src/client/efx.qc b/src/client/efx.qc index 0ceff69a..7997556e 100644 --- a/src/client/efx.qc +++ b/src/client/efx.qc @@ -13,6 +13,45 @@ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +void +EFX_DebugInfo(void) +{ + static vector pos = [16, 16]; + + static void epr(string tx) { + drawfont = FONT_CON; + drawstring(pos, tx, [12,12], [1,1,1], 1.0f, 0); + pos[1] += 12; + } + + pos = [16,16]; + epr("OpenAL EFX Debug Information:"); + epr(strcat("EFX Name: ", g_efx_name[g_iEFX])); + epr(sprintf("Density: %d", g_efx[g_iEFX].flDensity)); + epr(sprintf("Diffusion: %d", g_efx[g_iEFX].flDiffusion)); + epr(sprintf("Gain: %d", g_efx[g_iEFX].flGain)); + epr(sprintf("Gain HF: %d", g_efx[g_iEFX].flGainHF)); + epr(sprintf("Gain LF: %d", g_efx[g_iEFX].flGainLF)); + epr(sprintf("Decay Time: %d", g_efx[g_iEFX].flDecayTime)); + epr(sprintf("Decay HF Ratio: %d", g_efx[g_iEFX].flDecayHFRatio)); + epr(sprintf("Decay LF Ratio: %d", g_efx[g_iEFX].flDecayLFRatio)); + epr(sprintf("Reflections Gain: %d", g_efx[g_iEFX].flReflectionsGain)); + epr(sprintf("Reflections Delay: %d", g_efx[g_iEFX].flReflectionsDelay)); + epr(sprintf("Reflections Pan: %v", g_efx[g_iEFX].flReflectionsPan)); + epr(sprintf("Late Reverb Gain: %d", g_efx[g_iEFX].flLateReverbGain)); + epr(sprintf("Late Reverb Delay: %d", g_efx[g_iEFX].flLateReverbDelay)); + epr(sprintf("Late Reverb Pan: %v", g_efx[g_iEFX].flLateReverbPan)); + epr(sprintf("Echo Time: %d", g_efx[g_iEFX].flEchoTime)); + epr(sprintf("Echo Depth: %d", g_efx[g_iEFX].flEchoDepth)); + epr(sprintf("Modulation Time: %d", g_efx[g_iEFX].flModulationTime)); + epr(sprintf("Modulation Depth: %d", g_efx[g_iEFX].flModulationDepth)); + epr(sprintf("Air Absorption Gain HF: %d", g_efx[g_iEFX].flAirAbsorptionGainHF)); + epr(sprintf("HF Reference: %d", g_efx[g_iEFX].flHFReference)); + epr(sprintf("LF Reference: %d", g_efx[g_iEFX].flLFReference)); + epr(sprintf("Romm Rolloff Factor: %d", g_efx[g_iEFX].flRoomRolloffFactor)); + epr(sprintf("Decay HF Limit: %i", g_efx[g_iEFX].iDecayHFLimit)); +} int EFX_Load(string efx_file) diff --git a/src/client/entry.qc b/src/client/entry.qc index a1a98022..ac811e9e 100644 --- a/src/client/entry.qc +++ b/src/client/entry.qc @@ -415,6 +415,10 @@ CSQC_UpdateView(float w, float h, float focus) } EFX_UpdateListener(); + + if (autocvar_s_al_debug) + EFX_DebugInfo(); + pSeat = (void*)0x70000000i; pSeatLocal = (void*)0x70000000i;