Turbulence
0x0027c060 · 302 bytes · __cdecl
_Z10TurbulenceRK6Vectori
Decompiled
undefined (2 params)
/* Turbulence(Vector const&, int) */
longdouble Turbulence(Vector *param_1,int param_2)
{
int iVar1;
longdouble lVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
float local_28;
float local_24;
float local_20;
if (param_2 < 1) {
fVar6 = NAN;
}
else {
fVar5 = 0.0;
fVar3 = 1.0;
iVar1 = 0;
fVar4 = 1.0;
fVar6 = fVar5;
do {
iVar1 = iVar1 + 1;
local_28 = *(float *)param_1 * fVar3;
local_24 = *(float *)(param_1 + 4) * fVar3;
local_20 = fVar3 * *(float *)(param_1 + 8);
lVar2 = (longdouble)SparseConvolutionNoise((Vector *)&local_28,QuinticInterpolatingPolynomial)
;
fVar5 = fVar5 + fVar4;
fVar3 = fVar3 + fVar3;
fVar6 = ABS((float)lVar2 + -0.5 + (float)lVar2 + -0.5) * fVar4 + fVar6;
fVar4 = fVar4 * 0.5;
} while (iVar1 != param_2);
fVar6 = fVar6 / fVar5;
}
return (longdouble)fVar6;
}
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.