CalcBoneAdj
0x00b8d130 · 466 bytes · __cdecl
_Z11CalcBoneAdjPK10CStudioHdrP6VectorP10QuaternionPKfi
Decompiled
undefined (5 params)
/* CalcBoneAdj(CStudioHdr const*, Vector*, Quaternion*, float const*, int) */
void CalcBoneAdj(CStudioHdr *param_1,Vector *param_2,Quaternion *param_3,float *param_4,int param_5)
{
int iVar1;
int *piVar2;
int iVar3;
float fVar4;
int local_40;
float local_38;
float local_34;
float local_30;
Quaternion local_2c [28];
iVar3 = *(int *)param_1;
if (0 < *(int *)(iVar3 + 0xa4)) {
local_40 = 0;
do {
piVar2 = (int *)(local_40 * 0x38 + *(int *)(iVar3 + 0xa8) + iVar3);
iVar1 = *piVar2;
if ((*(uint *)(*(int *)(param_1 + 0x2c) + iVar1 * 4) & param_5) == 0)
goto switchD_00b8d1dd_caseD_0;
fVar4 = param_4[piVar2[5]];
if (fVar4 <= 0.0) {
fVar4 = 0.0;
}
if (1.0 <= fVar4) {
fVar4 = 1.0;
}
local_30 = (1.0 - fVar4) * (float)piVar2[2] + fVar4 * (float)piVar2[3];
switch(piVar2[1] & 0x3ffff) {
case 1:
*(float *)(param_2 + iVar1 * 0xc) = local_30 + *(float *)(param_2 + iVar1 * 0xc);
iVar3 = *(int *)param_1;
break;
case 2:
*(float *)(param_2 + iVar1 * 0xc + 4) = local_30 + *(float *)(param_2 + iVar1 * 0xc + 4);
iVar3 = *(int *)param_1;
break;
case 4:
*(float *)(param_2 + iVar1 * 0xc + 8) = local_30 + *(float *)(param_2 + iVar1 * 0xc + 8);
iVar3 = *(int *)param_1;
break;
case 8:
local_38 = local_30 * 0.017453292;
local_34 = 0.0;
local_30 = 0.0;
goto LAB_00b8d211;
case 0x10:
local_34 = local_30 * 0.017453292;
local_38 = 0.0;
local_30 = 0.0;
goto LAB_00b8d211;
case 0x20:
local_30 = local_30 * 0.017453292;
local_38 = 0.0;
local_34 = 0.0;
LAB_00b8d211:
AngleQuaternion((RadianEuler *)&local_38,local_2c);
QuaternionSM(1.0,local_2c,param_3 + iVar1 * 0x10,param_3 + iVar1 * 0x10);
iVar3 = *(int *)param_1;
}
switchD_00b8d1dd_caseD_0:
local_40 = local_40 + 1;
} while (local_40 < *(int *)(iVar3 + 0xa4));
}
return;
}
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.