TangentSpaceSurfaceSetup
0x00192eb0 · 233 bytes · __cdecl
_Z24TangentSpaceSurfaceSetupP11msurface2_tR6Vector
Decompiled
undefined (2 params)
/* TangentSpaceSurfaceSetup(msurface2_t*, Vector&) */
undefined4 TangentSpaceSurfaceSetup(msurface2_t *param_1,Vector *param_2)
{
float *pfVar1;
float local_18;
float local_14;
float local_10;
pfVar1 = (float *)((uint)(*(ushort *)(param_1 + 0x16) >> 1) * 0x50 + *(int *)(DAT_003a172c + 0x5c)
);
local_18 = *pfVar1;
local_14 = pfVar1[1];
local_10 = pfVar1[2];
*(float *)param_2 = pfVar1[4];
*(float *)(param_2 + 4) = pfVar1[5];
*(float *)(param_2 + 8) = pfVar1[6];
VectorNormalize((Vector *)&local_18);
VectorNormalize(param_2);
pfVar1 = *(float **)(param_1 + 4);
return CONCAT31((int3)((uint)pfVar1 >> 8),
0.0 < (*(float *)param_2 * local_10 - local_18 * *(float *)(param_2 + 8)) *
pfVar1[1] +
(*(float *)(param_2 + 8) * local_14 - local_10 * *(float *)(param_2 + 4)) *
*pfVar1 + (*(float *)(param_2 + 4) * local_18 - local_14 * *(float *)param_2
) * pfVar1[2]);
}
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.