L L4D2node

AccumulatePose

0x00b8e7b0 · 1962 bytes · __cdecl

_Z14AccumulatePosePK10CStudioHdrP10CIKContextP6VectorP10QuaternionifPKfiff

Decompiled

undefined (10 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* AccumulatePose(CStudioHdr const*, CIKContext*, Vector*, Quaternion*, int, float, float const*,
   int, float, float) */

void AccumulatePose(CStudioHdr *param_1,CIKContext *param_2,Vector *param_3,Quaternion *param_4,
                   int param_5,float param_6,float *param_7,int param_8,float param_9,float param_10
                   )

{
  Vector *pVVar1;
  QuaternionAligned *pQVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  char cVar5;
  int iVar6;
  Vector *pVVar7;
  QuaternionAligned *pQVar8;
  mstudioseqdesc_t *pmVar9;
  CUtlMemory<ikcontextikrule_t,int> *this;
  int iVar10;
  int in_GS_OFFSET;
  int local_10d8;
  undefined4 local_10bc;
  undefined4 local_10b8;
  matrix3x4_t local_10b0 [48];
  CIKContext local_1080 [4080];
  undefined4 local_90;
  CIKContext *local_8c;
  int local_84 [3];
  int local_78;
  int local_74;
  undefined4 local_70 [3];
  undefined4 local_64;
  undefined4 local_60;
  int local_20;
  
  local_10bc = 0;
  local_10b8 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (___atan2f_finite == 0) {
    local_10d8 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_10bc,0,0,0,0,"/data/src/bonesetup/bone_setup.cpp",0x278,
               &AccumulatePose(CStudioHdr_const*,CIKContext*,Vector*,Quaternion*,int,float,float_const*,int,float,float)
                ::tm_fmt,"(%s)%s","Unaccounted","AccumulatePose");
    local_10d8 = ___atan2f_finite;
  }
  uVar4 = local_10b8;
  uVar3 = local_10bc;
  iVar10 = _DAT_0105db00;
                    /* try { // try from 00b8e8b0 to 00b8e8b4 has its CatchHandler @ 00b8ef95 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar6 = ThreadGetCurrentId(), iVar10 == iVar6)) {
    if ((char *)*_DAT_0105d15c != "AccumulatePose") {
                    /* try { // try from 00b8ef28 to 00b8ef39 has its CatchHandler @ 00b8ef95 */
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd5455c,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 00b8eda7 to 00b8edab has its CatchHandler @ 00b8efdb */
  if (((*(int *)(cl_use_simd_bones._28_4_ + 0x30) != 0) && (((uint)param_4 & 0xf) != 0)) &&
     (cVar5 = Plat_IsInDebugSession(0), cVar5 != '\0')) {
    raise(5);
  }
  iVar10 = _DAT_0105db00;
  if (param_5 < 0) {
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar6 = ThreadGetCurrentId(), iVar10 == iVar6)) {
      cVar5 = CVProfNode::ExitScope();
      if (cVar5 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_10d8 != 0) {
      (**(code **)(local_10d8 + 0x54))(local_10d8,uVar3,uVar4,0,0,0);
    }
  }
  else {
    do {
      pVVar7 = g_VectorPool;
      if (g_VectorPool == (Vector *)0x0) {
        pVVar7 = (Vector *)memalign(0x10,0x600);
        if (((uint)pVVar7 & 0xf) != 0) {
          raise(5);
        }
        break;
      }
                    /* try { // try from 00b8e904 to 00b8e9cc has its CatchHandler @ 00b8efdb */
      cVar5 = ThreadInterlockedAssignIf64
                        (&g_VectorPool,*(undefined4 *)g_VectorPool,DAT_0104787c + -1,g_VectorPool,
                         DAT_0104787c);
    } while (cVar5 == '\0');
    do {
      pQVar8 = g_QuaternionPool;
      if (g_QuaternionPool == (QuaternionAligned *)0x0) {
        pQVar8 = (QuaternionAligned *)memalign(0x10,0x800);
        if (((uint)pQVar8 & 0xf) != 0) {
          raise(5);
        }
        break;
      }
      cVar5 = ThreadInterlockedAssignIf64
                        (&g_QuaternionPool,*(undefined4 *)g_QuaternionPool,DAT_01047884 + -1,
                         g_QuaternionPool,DAT_01047884);
    } while (cVar5 == '\0');
    pmVar9 = (mstudioseqdesc_t *)CStudioHdr::pSeqdesc(param_1,param_5);
    CIKContext::CIKContext(local_1080);
    if (*(int *)(pmVar9 + 0xa4) != 0) {
                    /* try { // try from 00b8ee89 to 00b8eeec has its CatchHandler @ 00b8f032 */
      SetIdentityMatrix(local_10b0);
      CIKContext::Init(local_1080,param_1,local_10b0,0.0,0,param_8);
      CIKContext::AddSequenceLocks(local_1080,pmVar9,param_3,param_4);
    }
    if (((byte)pmVar9[0xd] & 2) != 0) {
      InitPose(param_1,pVVar7,pQVar8,param_8);
    }
                    /* try { // try from 00b8ea28 to 00b8ec58 has its CatchHandler @ 00b8f032 */
    cVar5 = CalcPoseSingle(param_1,pVVar7,pQVar8,pmVar9,param_5,param_6,param_7,param_8,param_10);
    if (param_9 <= 0.0) {
      param_9 = 0.0;
    }
    if (1.0 <= param_9) {
      param_9 = 1.0;
    }
    if (cVar5 != '\0') {
      AddLocalLayers(param_1,param_2,pVVar7,(Quaternion *)pQVar8,pmVar9,param_5,param_6,param_7,
                     param_8,1.0,param_10);
      SlerpBones(param_1,param_4,param_3,pmVar9,param_5,pQVar8,pVVar7,param_9,param_8);
    }
    do {
      iVar10 = DAT_0104787c;
      pVVar1 = g_VectorPool;
      iVar6 = DAT_0104787c + 0x10001;
      *(Vector **)pVVar7 = g_VectorPool;
      cVar5 = ThreadInterlockedAssignIf64(&g_VectorPool,pVVar7,iVar6,pVVar1,iVar10);
    } while (cVar5 == '\0');
    do {
      iVar10 = DAT_01047884;
      pQVar2 = g_QuaternionPool;
      iVar6 = DAT_01047884 + 0x10001;
      *(QuaternionAligned **)pQVar8 = g_QuaternionPool;
      cVar5 = ThreadInterlockedAssignIf64(&g_QuaternionPool,pQVar8,iVar6,pQVar2,iVar10);
    } while (cVar5 == '\0');
    if (param_2 != (CIKContext *)0x0) {
      CIKContext::AddDependencies(param_2,pmVar9,param_5,param_6,param_7,param_9);
    }
    AddSequenceLayers(param_1,param_2,param_3,param_4,pmVar9,param_5,param_6,param_7,param_8,param_9
                      ,param_10);
    if (*(int *)(pmVar9 + 0xa4) != 0) {
      CIKContext::SolveSequenceLocks(local_1080,pmVar9,param_3,param_4);
    }
    local_64 = 0;
    CUtlMemory<ikcontextikrule_t,int>::Purge((CUtlMemory<ikcontextikrule_t,int> *)local_70);
    local_60 = local_70[0];
    CUtlMemory<ikcontextikrule_t,int>::Purge((CUtlMemory<ikcontextikrule_t,int> *)local_70);
    local_78 = local_78 + -1;
    if (-1 < local_78) {
      iVar10 = local_78 * 0x14;
      do {
        local_78 = local_78 + -1;
        this = (CUtlMemory<ikcontextikrule_t,int> *)(local_84[0] + iVar10);
        iVar10 = iVar10 + -0x14;
        *(undefined4 *)(this + 0xc) = 0;
        CUtlMemory<ikcontextikrule_t,int>::Purge(this);
        *(undefined4 *)(this + 0x10) = *(undefined4 *)this;
        CUtlMemory<ikcontextikrule_t,int>::Purge(this);
      } while (local_78 != -1);
    }
    local_78 = 0;
    CUtlMemory<CUtlVector<ikcontextikrule_t,CUtlMemory<ikcontextikrule_t,int>>,int>::Purge
              ((CUtlMemory<CUtlVector<ikcontextikrule_t,CUtlMemory<ikcontextikrule_t,int>>,int> *)
               local_84);
    local_74 = local_84[0];
    CUtlMemory<CUtlVector<ikcontextikrule_t,CUtlMemory<ikcontextikrule_t,int>>,int>::Purge
              ((CUtlMemory<CUtlVector<ikcontextikrule_t,CUtlMemory<ikcontextikrule_t,int>>,int> *)
               local_84);
    iVar10 = _DAT_0105db00;
    local_8c = local_1080;
    local_90 = 0;
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar6 = ThreadGetCurrentId(), iVar10 == iVar6)) {
      cVar5 = CVProfNode::ExitScope();
      if (cVar5 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_10d8 != 0) {
      (**(code **)(local_10d8 + 0x54))(local_10d8,uVar3,uVar4,0,0,0);
    }
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)