Client: Add an OSD for various EFX debug info when s_al_debug is enabled.

This commit is contained in:
Marco Cawthorne 2021-04-27 12:53:21 +02:00
parent 69caffe91c
commit eaff488dc2
3 changed files with 45 additions and 0 deletions

View file

@ -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;

View file

@ -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)

View file

@ -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;