L L4D2node

CDispCollTree::AABBTree_CreateLeafs

0x000cdab0 · 387 bytes · __thiscall

_ZN13CDispCollTree20AABBTree_CreateLeafsEv

Decompiled

undefined (1 param)

/* CDispCollTree::AABBTree_CreateLeafs() */

void __thiscall CDispCollTree::AABBTree_CreateLeafs(CDispCollTree *this)

{
  short sVar1;
  uint uVar2;
  byte bVar3;
  uint uVar4;
  byte bVar5;
  uint uVar6;
  int iVar7;
  uint uVar8;
  short local_2a;
  uint local_24;
  byte local_20;
  
  *(undefined4 *)(this + 0xa8) = 0;
  local_20 = (byte)*(undefined4 *)(this + 0x28);
  iVar7 = 1 << (local_20 & 0x1f);
  iVar7 = iVar7 * iVar7;
  if (iVar7 != 0) {
    CUtlVector<CDispCollLeaf,CHunkMemory<CDispCollLeaf>>::GrowVector
              ((CUtlVector<CDispCollLeaf,CHunkMemory<CDispCollLeaf>> *)(this + 0xa0),iVar7);
    CUtlVector<CDispCollLeaf,CHunkMemory<CDispCollLeaf>>::ShiftElementsRight
              ((CUtlVector<CDispCollLeaf,CHunkMemory<CDispCollLeaf>> *)(this + 0xa0),0,iVar7);
    local_20 = (byte)*(undefined4 *)(this + 0x28);
  }
  *(undefined4 *)(this + 0x98) = 0;
  iVar7 = (1 << (local_20 * '\x02' + 2 & 0x1f)) / 3 - iVar7;
  if (iVar7 != 0) {
    CUtlVector<CDispCollNode,CHunkMemory<CDispCollNode>>::GrowVector
              ((CUtlVector<CDispCollNode,CHunkMemory<CDispCollNode>> *)(this + 0x90),iVar7);
    CUtlVector<CDispCollNode,CHunkMemory<CDispCollNode>>::ShiftElementsRight
              ((CUtlVector<CDispCollNode,CHunkMemory<CDispCollNode>> *)(this + 0x90),0,iVar7);
    local_20 = (byte)*(undefined4 *)(this + 0x28);
  }
  uVar2 = 1 << (local_20 & 0x1f);
  if (0 < (int)uVar2) {
    local_24 = 0;
    local_2a = 0;
    do {
      uVar8 = 0;
      uVar4 = 0;
      sVar1 = local_2a;
      while( true ) {
        if (local_24 != 0) {
          bVar5 = 1;
          uVar6 = local_24;
          do {
            bVar3 = bVar5 & 0x1f;
            bVar5 = bVar5 + 2;
            uVar4 = uVar4 | (uVar6 & 1) << bVar3;
            uVar6 = (int)uVar6 >> 1;
          } while (uVar6 != 0);
        }
        uVar8 = uVar8 + 1;
        *(short *)(*(int *)(this + 0xa0) + uVar4 * 4) = sVar1;
        *(short *)(*(int *)(this + 0xa0) + 2 + uVar4 * 4) = sVar1 + 1;
        if (uVar8 == uVar2) break;
        if (uVar8 == 0) {
          sVar1 = sVar1 + 2;
          uVar4 = 0;
        }
        else {
          uVar4 = 0;
          bVar5 = 0;
          uVar6 = uVar8;
          do {
            bVar3 = bVar5 & 0x1f;
            bVar5 = bVar5 + 2;
            uVar4 = uVar4 | (uVar6 & 1) << bVar3;
            uVar6 = (int)uVar6 >> 1;
          } while (uVar6 != 0);
          sVar1 = sVar1 + 2;
        }
      }
      local_24 = local_24 + 1;
      local_2a = local_2a + (short)uVar2 * 2;
    } while (local_24 != uVar2);
  }
  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)