CSoundParametersInternal::VolumeToString
0x00598fa0 · 866 bytes · __thiscall
_ZNK24CSoundParametersInternal14VolumeToStringEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CSoundParametersInternal::VolumeToString() const */
undefined1 * __thiscall CSoundParametersInternal::VolumeToString(CSoundParametersInternal *this)
{
ushort uVar1;
ushort uVar2;
byte bVar3;
float fVar4;
float fVar5;
double dVar6;
uVar1 = *(ushort *)(this + 0xe);
if (uVar1 == ZERO_FLOAT16) {
uVar1 = *(ushort *)(this + 0xc);
if ((uVar1 & 0x7fff) == 0x7c00) {
fVar4 = 65504.0;
if ((short)uVar1 < 0) {
fVar4 = -65504.0;
}
}
else {
bVar3 = (byte)(uVar1 >> 8);
if ((bVar3 & 0x7c) == 0x7c) {
fVar4 = 0.0;
if ((uVar1 & 0x3ff) != 0) goto LAB_00599256;
}
else if (((uVar1 & 0x7c00) == 0) && ((uVar1 & 0x3ff) != 0)) {
fVar4 = 1.0;
if ((short)uVar1 < 0) {
fVar4 = -1.0;
}
fVar4 = ((float)(uVar1 & 0x3ff) + 0.0) * 5.9604645e-08 * fVar4;
goto LAB_00599256;
}
fVar4 = (float)((uVar1 & 0x3ff) << 0xd | (uint)(bVar3 >> 7) << 0x1f |
(uint)((uVar1 >> 10 & 0x1f) != 0) * ((uVar1 >> 10 & 0x1f) + 0x70) * 0x800000);
}
LAB_00599256:
if (fVar4 == _g_pVolumeLevels) {
return PTR_s_VOL_NORM_00f212cc;
}
V_snprintf(_VolumeToString(float)::sz,0x20,"%.3f",(double)fVar4);
return _VolumeToString(float)::sz;
}
uVar2 = *(ushort *)(this + 0xc);
if ((uVar2 & 0x7fff) == 0x7c00) {
if ((short)uVar2 < 0) {
dVar6 = -65504.0;
fVar4 = -65504.0;
}
else {
dVar6 = 65504.0;
fVar4 = 65504.0;
}
}
else {
bVar3 = (byte)(uVar2 >> 8);
if ((bVar3 & 0x7c) == 0x7c) {
dVar6 = 0.0;
fVar4 = 0.0;
if ((uVar2 & 0x3ff) == 0) goto LAB_00598ff4;
}
else {
if (((uVar2 & 0x7c00) == 0) && ((uVar2 & 0x3ff) != 0)) {
fVar4 = 1.0;
if ((short)uVar2 < 0) {
fVar4 = -1.0;
}
fVar4 = ((float)(uVar2 & 0x3ff) + 0.0) * 5.9604645e-08 * fVar4;
}
else {
LAB_00598ff4:
fVar4 = (float)((uVar2 & 0x3ff) << 0xd | (uint)(bVar3 >> 7) << 0x1f |
(uint)((uVar2 >> 10 & 0x1f) != 0) * ((uVar2 >> 10 & 0x1f) + 0x70) * 0x800000)
;
}
dVar6 = (double)fVar4;
}
}
bVar3 = (byte)(uVar1 >> 8);
if ((uVar1 & 0x7fff) == 0x7c00) {
fVar5 = 65504.0;
if ((short)uVar1 < 0) {
fVar5 = -65504.0;
}
}
else {
if ((bVar3 & 0x7c) == 0x7c) {
fVar5 = 0.0;
if ((uVar1 & 0x3ff) != 0) goto LAB_0059909a;
}
else if (((uVar1 & 0x7c00) == 0) && ((uVar1 & 0x3ff) != 0)) {
fVar5 = 1.0;
if ((short)uVar1 < 0) {
fVar5 = -1.0;
}
fVar5 = ((float)(uVar1 & 0x3ff) + 0.0) * 5.9604645e-08 * fVar5;
goto LAB_0059909a;
}
fVar5 = (float)((uVar1 & 0x3ff) << 0xd | (uint)(bVar3 >> 7) << 0x1f |
(uint)((uVar1 >> 10 & 0x1f) != 0) * ((uVar1 >> 10 & 0x1f) + 0x70) * 0x800000);
}
LAB_0059909a:
V_snprintf(VolumeToString()::sz,0x40,"%.3f, %.3f",dVar6,(double)(fVar4 + fVar5));
return VolumeToString()::sz;
}
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.