SetupSingleBoneMatrix
0x00b9a290 · 505 bytes · __cdecl
_Z21SetupSingleBoneMatrixP10CStudioHdriiiR11matrix3x4_t
Decompiled
undefined (5 params)
/* SetupSingleBoneMatrix(CStudioHdr*, int, int, int, matrix3x4_t&) */
void SetupSingleBoneMatrix
(CStudioHdr *param_1,int param_2,int param_3,int param_4,matrix3x4_t *param_5)
{
uint uVar1;
int iVar2;
int iVar3;
mstudioanimdesc_t *this;
mstudio_rle_anim_t *pmVar4;
int iVar5;
int iVar6;
int local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
iVar2 = CStudioHdr::pSeqdesc(param_1,param_2);
iVar6 = *(int *)(iVar2 + 0x44);
iVar3 = 0;
if (iVar6 < 1) {
iVar3 = iVar6 + -1;
}
iVar5 = 0;
if (*(int *)(iVar2 + 0x48) < 1) {
iVar5 = (*(int *)(iVar2 + 0x48) + -1) * iVar6;
}
this = (mstudioanimdesc_t *)
CStudioHdr::pAnimdesc
(param_1,(int)*(short *)(iVar2 + (iVar3 + iVar5) * 2 + *(int *)(iVar2 + 0x3c)));
local_3c = param_3;
iVar6 = *(int *)param_1 + param_4 * 0xd8 + *(int *)(*(int *)param_1 + 0xa0);
uVar1 = *(uint *)(this + 0xc);
if ((uVar1 & 0x40) == 0) {
for (pmVar4 = (mstudio_rle_anim_t *)mstudioanimdesc_t::pAnim(this,&local_3c);
pmVar4 != (mstudio_rle_anim_t *)0x0; pmVar4 = pmVar4 + *(short *)(pmVar4 + 2)) {
if ((uint)(byte)*pmVar4 == param_4) {
if (0.0 < *(float *)(iVar2 + param_4 * 4 + *(int *)(iVar2 + 0x9c))) {
CalcBoneQuaternion(local_3c,0.0,(Quaternion *)(iVar6 + 0x2c),(RadianEuler *)(iVar6 + 0x3c)
,(Vector *)(iVar6 + 0x54),*(int *)(iVar6 + 0xa0),
(Quaternion *)(iVar6 + 0x90),pmVar4,(Quaternion *)&local_2c);
CalcBonePosition(local_3c,0.0,(Vector *)(iVar6 + 0x20),(Vector *)(iVar6 + 0x48),pmVar4,
(Vector *)&local_38);
goto LAB_00b9a34c;
}
break;
}
if (*(short *)(pmVar4 + 2) == 0) break;
}
uVar1 = *(uint *)(this + 0xc);
}
if ((uVar1 & 4) == 0) {
local_2c = *(undefined4 *)(iVar6 + 0x2c);
local_38 = *(undefined4 *)(iVar6 + 0x20);
local_34 = *(undefined4 *)(iVar6 + 0x24);
local_28 = *(undefined4 *)(iVar6 + 0x30);
local_30 = *(undefined4 *)(iVar6 + 0x28);
local_24 = *(undefined4 *)(iVar6 + 0x34);
local_20 = *(undefined4 *)(iVar6 + 0x38);
}
else {
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = 0x3f800000;
local_38 = 0;
local_34 = 0;
local_30 = 0;
}
LAB_00b9a34c:
QuaternionMatrix((Quaternion *)&local_2c,(Vector *)&local_38,param_5);
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.