SlerpBones
0x00b93740 · 1016 bytes · __cdecl
_Z10SlerpBonesPK10CStudioHdrP10QuaternionP6VectorR16mstudioseqdesc_tiPK17QuaternionAlignedPKS4_fi
Decompiled
undefined (9 params)
/* SlerpBones(CStudioHdr const*, Quaternion*, Vector*, mstudioseqdesc_t&, int, QuaternionAligned
const*, Vector const*, float, int) */
void SlerpBones(CStudioHdr *param_1,Quaternion *param_2,Vector *param_3,mstudioseqdesc_t *param_4,
int param_5,QuaternionAligned *param_6,Vector *param_7,float param_8,int param_9)
{
float fVar1;
float fVar2;
mstudioseqdesc_t mVar3;
byte bVar4;
uint uVar5;
int iVar6;
int iVar7;
int iVar8;
int iVar9;
int iVar10;
CStudioHdr *pCVar11;
undefined1 *puVar12;
Vector *pVVar13;
int in_GS_OFFSET;
undefined4 uStackY_90;
float local_60;
QuaternionAligned *local_5c;
Vector *local_58;
Quaternion *local_54;
CStudioHdr *local_50;
CStudioHdr *local_4c;
mstudioseqdesc_t *local_48;
Vector *local_44;
int local_40;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
int local_20;
puVar12 = &stack0xffffff74;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_58 = param_3;
local_50 = param_1;
local_48 = param_4;
local_54 = param_2;
local_5c = param_6;
if (((((uint)param_2 | (uint)param_6) & 0xf) == 0) && (*(int *)(cl_simdbones._28_4_ + 0x30) != 0))
{
uStackY_90 = 0xb93a04;
SlerpBonesSpeedy(param_1,(QuaternionAligned *)param_2,param_3,param_4,param_5,param_6,param_7,
param_8,param_9);
}
else {
puVar12 = &stack0xffffff74;
if (0.0 < param_8) {
if (1.0 <= param_8) {
param_8 = 1.0;
}
uVar5 = *(uint *)(param_4 + 0xc);
if ((uVar5 & 0x4000) == 0) {
iVar6 = *(int *)(param_1 + 4);
if (iVar6 == 0) {
pCVar11 = (CStudioHdr *)0x0;
}
else {
pCVar11 = (CStudioHdr *)
(*(int *)(param_5 * 0x10 + *(int *)(iVar6 + 8) + 8) * 0x90 +
*(int *)(iVar6 + 0x58));
}
local_44 = *(Vector **)(*(int *)param_1 + 0x9c);
iVar6 = (int)local_44 * 4;
iVar8 = -((iVar6 + 0xfU & 0xfffffff0) + 0x10);
puVar12 = &stack0xffffff74 + iVar8;
local_40 = (int)&local_60 + iVar8;
if ((int)local_44 < 1) {
if ((uVar5 & 4) == 0) goto LAB_00b9399f;
}
else {
iVar7 = *(int *)(param_1 + 0x2c);
iVar10 = 0;
do {
while ((*(uint *)(iVar7 + iVar10) & param_9) != 0) {
iVar9 = iVar10;
if (pCVar11 != (CStudioHdr *)0x0) {
if (*(int *)(*(int *)(pCVar11 + 4) + iVar10) < 0) break;
iVar9 = *(int *)(*(int *)(pCVar11 + 4) + iVar10) * 4;
}
*(float *)(local_40 + iVar10) =
*(float *)(param_4 + *(int *)(param_4 + 0x9c) + iVar9) * param_8;
iVar10 = iVar10 + 4;
if (iVar6 - iVar10 == 0) goto LAB_00b93871;
}
*(undefined4 *)(local_40 + iVar10) = 0;
iVar10 = iVar10 + 4;
} while (iVar6 - iVar10 != 0);
LAB_00b93871:
local_4c = pCVar11;
if ((uVar5 & 4) == 0) {
pVVar13 = (Vector *)0x0;
do {
pCVar11 = *(CStudioHdr **)(local_40 + (int)pVVar13 * 4);
if (0.0 < (float)pCVar11) {
local_54 = (Quaternion *)param_7;
local_58 = pVVar13;
local_4c = pCVar11;
local_48 = (mstudioseqdesc_t *)(1.0 - (float)pCVar11);
bVar4 = *(byte *)(*(int *)(local_50 + 0x2c) + 2 + (int)pVVar13 * 4);
*(undefined4 **)(&stack0xffffff80 + iVar8) = &local_3c;
*(mstudioseqdesc_t **)(&stack0xffffff7c + iVar8) =
(mstudioseqdesc_t *)(1.0 - (float)pCVar11);
*(Quaternion **)(&stack0xffffff78 + iVar8) = param_2;
*(QuaternionAligned **)(&stack0xffffff74 + iVar8) = param_6;
if ((bVar4 & 0x10) == 0) {
*(undefined4 *)((int)&uStackY_90 + iVar8) = 0xb93b38;
QuaternionSlerp(*(Quaternion **)(&stack0xffffff74 + iVar8),
*(Quaternion **)(&stack0xffffff78 + iVar8),
*(float *)(&stack0xffffff7c + iVar8),
*(Quaternion **)(&stack0xffffff80 + iVar8));
}
else {
*(undefined4 *)((int)&uStackY_90 + iVar8) = 0xb93a4d;
QuaternionSlerpNoAlign
(*(Quaternion **)(&stack0xffffff74 + iVar8),
*(Quaternion **)(&stack0xffffff78 + iVar8),
*(float *)(&stack0xffffff7c + iVar8),
*(Quaternion **)(&stack0xffffff80 + iVar8));
}
*(undefined4 *)param_2 = local_3c;
*(undefined4 *)(param_2 + 4) = local_38;
*(undefined4 *)(param_2 + 8) = local_34;
*(undefined4 *)(param_2 + 0xc) = local_30;
*(float *)param_3 =
*(float *)param_3 * (float)local_48 + *(float *)local_54 * (float)local_4c;
*(float *)(param_3 + 4) =
*(float *)(param_3 + 4) * (float)local_48 +
*(float *)(local_54 + 4) * (float)local_4c;
*(float *)(param_3 + 8) =
(float)local_48 * *(float *)(param_3 + 8) +
(float)local_4c * *(float *)(local_54 + 8);
param_7 = (Vector *)local_54;
pVVar13 = local_58;
}
pVVar13 = pVVar13 + 1;
param_2 = param_2 + 0x10;
param_3 = param_3 + 0xc;
param_7 = param_7 + 0xc;
param_6 = param_6 + 0x10;
puVar12 = &stack0xffffff74 + iVar8;
} while (pVVar13 != local_44);
goto LAB_00b9399f;
}
}
puVar12 = &stack0xffffff74 + iVar8;
if (0 < (int)local_44) {
pVVar13 = (Vector *)0x0;
do {
pCVar11 = *(CStudioHdr **)(local_40 + (int)pVVar13 * 4);
if (0.0 < (float)pCVar11) {
local_54 = (Quaternion *)param_7;
mVar3 = local_48[0xc];
*(Quaternion **)(&stack0xffffff80 + iVar8) = param_2;
if (((byte)mVar3 & 0x10) == 0) {
*(Quaternion **)(&stack0xffffff7c + iVar8) = param_2;
*(CStudioHdr **)(&stack0xffffff74 + iVar8) = pCVar11;
*(QuaternionAligned **)(&stack0xffffff78 + iVar8) = param_6;
local_50 = (CStudioHdr *)param_2;
local_4c = pCVar11;
*(undefined4 *)((int)&uStackY_90 + iVar8) = 0xb9394d;
QuaternionSM(*(float *)(&stack0xffffff74 + iVar8),
*(Quaternion **)(&stack0xffffff78 + iVar8),
*(Quaternion **)(&stack0xffffff7c + iVar8),
*(Quaternion **)(&stack0xffffff80 + iVar8));
param_2 = (Quaternion *)local_50;
pCVar11 = local_4c;
}
else {
*(CStudioHdr **)(&stack0xffffff78 + iVar8) = pCVar11;
*(Quaternion **)(&stack0xffffff74 + iVar8) = param_2;
*(QuaternionAligned **)(&stack0xffffff7c + iVar8) = param_6;
local_50 = pCVar11;
local_4c = (CStudioHdr *)param_2;
*(undefined4 *)((int)&uStackY_90 + iVar8) = 0xb938ba;
QuaternionMA(*(Quaternion **)(&stack0xffffff74 + iVar8),
*(float *)(&stack0xffffff78 + iVar8),
*(Quaternion **)(&stack0xffffff7c + iVar8),
*(Quaternion **)(&stack0xffffff80 + iVar8));
param_2 = (Quaternion *)local_4c;
pCVar11 = local_50;
}
fVar1 = *(float *)(local_54 + 8);
fVar2 = *(float *)local_54;
*(float *)(param_3 + 4) =
*(float *)(local_54 + 4) * (float)pCVar11 + *(float *)(param_3 + 4);
*(float *)(param_3 + 8) = fVar1 * (float)pCVar11 + *(float *)(param_3 + 8);
*(float *)param_3 = (float)pCVar11 * fVar2 + *(float *)param_3;
param_7 = (Vector *)local_54;
}
pVVar13 = pVVar13 + 1;
param_3 = param_3 + 0xc;
param_7 = param_7 + 0xc;
param_2 = param_2 + 0x10;
param_6 = param_6 + 0x10;
puVar12 = &stack0xffffff74 + iVar8;
} while (pVVar13 != local_44);
}
}
else {
uStackY_90 = 0xb9399f;
WorldSpaceSlerp(param_1,param_2,param_3,param_4,param_5,(Quaternion *)param_6,param_7,
param_8,param_9);
puVar12 = &stack0xffffff74;
}
}
}
LAB_00b9399f:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
*(undefined **)(puVar12 + -4) = &UNK_00b93a25;
__stack_chk_fail();
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.