S_GetGainFromSoundLevel
0x001dbb90 · 182 bytes · __cdecl
_Z23S_GetGainFromSoundLevel12soundlevel_tf
Decompiled
undefined (2 params)
/* S_GetGainFromSoundLevel(soundlevel_t, float) */
longdouble S_GetGainFromSoundLevel(uint param_1,float param_2)
{
float fVar1;
longdouble lVar2;
float fVar3;
fVar3 = snd_refdb_dist_mult;
fVar1 = *(float *)(snd_gain._28_4_ + 0x2c);
if (param_1 != 0) {
lVar2 = (longdouble)
FastPow10(((float)(param_1 >> 0x10) * 65536.0 + (float)(param_1 & 0xffff)) * 0.05);
fVar3 = fVar3 / ((float)lVar2 * *(float *)(snd_refdist._28_4_ + 0x2c));
if (fVar3 != 0.0) {
lVar2 = (longdouble)SND_GetGainFromMult(fVar1,fVar3,param_2);
return (longdouble)(float)lVar2;
}
}
return (longdouble)fVar1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.