FastCos
0x00bc54d0 · 316 bytes · __cdecl
_Z7FastCosf
Decompiled
undefined (1 param)
/* FastCos(float) */
longdouble FastCos(float param_1)
{
uint uVar1;
uint uVar2;
float fVar3;
float fVar4;
uVar1 = (int)(ABS(param_1) * (float)0x3fa2f983) + 1U & 0xfffffffe;
fVar3 = (float)(int)uVar1;
uVar1 = uVar1 - 2;
uVar2 = -(uint)((uVar1 & 2) == 0);
fVar3 = fVar3 * (float)0xbf490000 + ABS(param_1) + fVar3 * (float)0xb97da000 +
fVar3 * (float)0xb3222169;
fVar4 = fVar3 * fVar3;
return (longdouble)
(float)((uint)((float)(~uVar2 & (uint)((((fVar4 * (float)0x37ccf5ce + (float)0xbab6061a) *
fVar4 + (float)0x3d2aaaa5) * fVar4 -
(float)0x3f000000) * fVar4 + (float)0x3f800000)) +
(float)((uint)(((fVar4 * (float)0xb94ca1f9 + (float)0x3c08839e) * fVar4 +
(float)0xbe2aaaa3) * fVar4 * fVar3 + fVar3) & uVar2)) ^
(~uVar1 & 4) << 0x1d);
}
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.