CDispCollTree::AABBTree_CopyDispData
0x000cdc40 · 1405 bytes · __thiscall
_ZN13CDispCollTree21AABBTree_CopyDispDataEP13CCoreDispInfo
Decompiled
undefined (2 params)
/* CDispCollTree::AABBTree_CopyDispData(CCoreDispInfo*) */
void __thiscall CDispCollTree::AABBTree_CopyDispData(CDispCollTree *this,CCoreDispInfo *param_1)
{
ushort *puVar1;
int iVar2;
CDispCollTree *pCVar3;
void *pvVar4;
int iVar5;
undefined2 *puVar6;
CCoreDispInfo *pCVar7;
int iVar8;
int iVar9;
undefined4 *puVar10;
int iVar11;
float fVar12;
float fVar13;
float fVar14;
float fVar15;
float fVar16;
float fVar17;
byte local_30;
ushort local_22;
ushort local_20;
ushort local_1e [7];
*(undefined4 *)(this + 0x28) = *(undefined4 *)(param_1 + 0xc);
*(undefined4 *)(this + 0x20) = *(undefined4 *)(param_1 + 0x18c);
fVar12 = *(float *)(param_1 + 0x24) - *(float *)(param_1 + 0x18);
fVar15 = *(float *)(param_1 + 0x3c) - *(float *)(param_1 + 0x18);
fVar14 = *(float *)(param_1 + 0x28) - *(float *)(param_1 + 0x1c);
fVar13 = *(float *)(param_1 + 0x40) - *(float *)(param_1 + 0x1c);
fVar17 = *(float *)(param_1 + 0x44) - *(float *)(param_1 + 0x20);
fVar16 = *(float *)(param_1 + 0x2c) - *(float *)(param_1 + 0x20);
*(float *)(this + 0x60) = fVar13 * fVar16 - fVar17 * fVar14;
*(float *)(this + 100) = fVar17 * fVar12 - fVar16 * fVar15;
*(float *)(this + 0x68) = fVar14 * fVar15 - fVar12 * fVar13;
VectorNormalize((Vector *)(this + 0x60));
iVar5 = 0;
pCVar3 = this;
pCVar7 = param_1;
do {
iVar5 = iVar5 + 1;
*(undefined4 *)(pCVar3 + 0x30) = *(undefined4 *)(pCVar7 + 0x18);
*(undefined4 *)(pCVar3 + 0x34) = *(undefined4 *)(pCVar7 + 0x1c);
*(undefined4 *)(pCVar3 + 0x38) = *(undefined4 *)(pCVar7 + 0x20);
pCVar3 = pCVar3 + 0xc;
pCVar7 = pCVar7 + 0xc;
} while (iVar5 != 4);
*(undefined4 *)(this + 0x78) = 0;
local_30 = (byte)*(undefined4 *)(this + 0x28);
iVar5 = 1 << (local_30 & 0x1f);
iVar11 = (iVar5 + 1) * (iVar5 + 1);
if (iVar11 != 0) {
iVar5 = *(int *)(this + 0x74);
if (iVar11 - iVar5 == 0 || iVar11 < iVar5) {
*(int *)(this + 0x78) = iVar11;
*(undefined4 *)(this + 0x7c) = *(undefined4 *)(this + 0x70);
}
else {
pvVar4 = (void *)Hunk_AllocName((iVar11 - iVar5) * 0xc,(char *)0x0,false);
iVar8 = *(int *)(this + 0x78);
*(int *)(this + 0x74) = iVar11 - iVar5;
*(void **)(this + 0x70) = pvVar4;
*(void **)(this + 0x7c) = pvVar4;
*(int *)(this + 0x78) = iVar11 + iVar8;
if ((0 < iVar11) && (0 < iVar8)) {
_V_memmove((void *)((int)pvVar4 + iVar11 * 0xc),pvVar4,iVar8 * 0xc);
local_30 = (byte)*(undefined4 *)(this + 0x28);
iVar5 = 1 << (local_30 & 0x1f);
goto LAB_000cdd46;
}
local_30 = (byte)*(undefined4 *)(this + 0x28);
}
iVar5 = 1 << (local_30 & 0x1f);
}
LAB_000cdd46:
*(undefined4 *)(this + 0x88) = 0;
iVar8 = iVar5 << (local_30 & 0x1f);
iVar11 = iVar8 * 2;
if (iVar11 == 0) goto LAB_000cdd62;
if (*(int *)(this + 0x84) < iVar11) {
iVar5 = iVar11 - *(int *)(this + 0x84);
pvVar4 = (void *)Hunk_AllocName(iVar5 * 0x18,(char *)0x0,false);
*(int *)(this + 0x84) = iVar5;
*(void **)(this + 0x80) = pvVar4;
iVar5 = *(int *)(this + 0x88);
*(void **)(this + 0x8c) = pvVar4;
*(int *)(this + 0x88) = iVar11 + iVar5;
if (0 < iVar11) {
if (0 < iVar5) {
_V_memmove((void *)((int)pvVar4 + iVar8 * 0x30),pvVar4,iVar5 * 0x18);
}
goto LAB_000ce037;
}
}
else {
*(int *)(this + 0x88) = iVar11;
*(undefined4 *)(this + 0x8c) = *(undefined4 *)(this + 0x80);
LAB_000ce037:
iVar5 = 0;
iVar8 = 0;
if (0 < iVar11) {
do {
puVar6 = (undefined2 *)(iVar5 + *(int *)(this + 0x80));
if (puVar6 != (undefined2 *)0x0) {
*(undefined4 *)(puVar6 + 4) = 0;
puVar6[2] = 0;
puVar6[1] = 0;
*(undefined4 *)(puVar6 + 6) = 0;
*(undefined4 *)(puVar6 + 8) = 0;
*(undefined4 *)(puVar6 + 10) = 0;
*puVar6 = 0;
}
iVar8 = iVar8 + 1;
iVar5 = iVar5 + 0x18;
} while (iVar8 < iVar11);
}
}
local_30 = (byte)*(undefined4 *)(this + 0x28);
iVar5 = 1 << (local_30 & 0x1f);
LAB_000cdd62:
*(undefined4 *)(this + 0xa8) = 0;
iVar5 = iVar5 * iVar5;
if (iVar5 != 0) {
CUtlVector<CDispCollLeaf,CHunkMemory<CDispCollLeaf>>::GrowVector
((CUtlVector<CDispCollLeaf,CHunkMemory<CDispCollLeaf>> *)(this + 0xa0),iVar5);
CUtlVector<CDispCollLeaf,CHunkMemory<CDispCollLeaf>>::ShiftElementsRight
((CUtlVector<CDispCollLeaf,CHunkMemory<CDispCollLeaf>> *)(this + 0xa0),0,iVar5);
local_30 = (byte)*(undefined4 *)(this + 0x28);
}
*(undefined4 *)(this + 0x98) = 0;
iVar11 = 0;
iVar5 = (1 << (local_30 * '\x02' + 2 & 0x1f)) / 3 - iVar5;
if (iVar5 != 0) {
CUtlVector<CDispCollNode,CHunkMemory<CDispCollNode>>::GrowVector
((CUtlVector<CDispCollNode,CHunkMemory<CDispCollNode>> *)(this + 0x90),iVar5);
CUtlVector<CDispCollNode,CHunkMemory<CDispCollNode>>::ShiftElementsRight
((CUtlVector<CDispCollNode,CHunkMemory<CDispCollNode>> *)(this + 0x90),0,iVar5);
local_30 = (byte)*(undefined4 *)(this + 0x28);
iVar11 = *(int *)(this + 0x98) * 0x60;
}
iVar9 = 1 << (local_30 & 0x1f);
iVar5 = iVar9 + 1;
iVar8 = 0;
*(int *)(this + 0xf0) =
iVar11 + 0x804 + *(int *)(this + 0xa8) * 4 + iVar5 * iVar5 * 0xc +
(iVar9 << (local_30 & 0x1f)) * 0x30;
iVar5 = 0;
if (0 < *(int *)(this + 0x78)) {
do {
iVar8 = iVar8 + 1;
puVar10 = (undefined4 *)(*(int *)(this + 0x70) + iVar5);
iVar11 = *(int *)(param_1 + 0x1b8) + iVar5 * 0xc;
*puVar10 = *(undefined4 *)(iVar11 + 0x28);
puVar10[1] = *(undefined4 *)(iVar11 + 0x2c);
puVar10[2] = *(undefined4 *)(iVar11 + 0x30);
iVar5 = iVar5 + 0xc;
} while (iVar8 < *(int *)(this + 0x78));
}
if (0 < *(int *)(this + 0x88)) {
iVar5 = 0;
do {
CCoreDispInfo::GetTriIndices(param_1,iVar5,&local_22,&local_20,local_1e);
iVar11 = iVar5 * 0x18;
fVar12 = 0.0;
*(ushort *)(*(int *)(this + 0x80) + iVar5 * 0x18) =
*(ushort *)(*(int *)(this + 0x80) + iVar5 * 0x18) & 0xfe00 | local_22 & 0x1ff;
*(ushort *)(*(int *)(this + 0x80) + 2 + iVar11) =
*(ushort *)(*(int *)(this + 0x80) + 2 + iVar11) & 0xfe00 | local_20 & 0x1ff;
*(ushort *)(*(int *)(this + 0x80) + 4 + iVar11) =
*(ushort *)(*(int *)(this + 0x80) + 4 + iVar11) & 0xfe00 | local_1e[0] & 0x1ff;
*(ushort *)(*(int *)(this + 0x80) + 6 + iVar11) =
*(ushort *)(*(int *)(this + 0x80) + 6 + iVar11) & 0xf83f |
(*(byte *)(*(int *)(param_1 + 0x1bc) + 6 + iVar5 * 8) & 0x1f) << 6;
iVar9 = *(int *)(this + 0x80) + iVar11;
iVar8 = 0;
do {
iVar2 = iVar8 * 2;
iVar8 = iVar8 + 1;
fVar12 = fVar12 + *(float *)(*(int *)(param_1 + 0x1b8) + 0x8c +
(*(ushort *)(iVar9 + iVar2) & 0x1ff) * 0x90);
} while (iVar8 != 3);
if (fVar12 <= 382.5) {
*(ushort *)(iVar9 + 6) = *(ushort *)(iVar9 + 6) | 0x200;
}
else {
*(ushort *)(iVar9 + 6) = *(ushort *)(iVar9 + 6) | 0x400;
}
iVar5 = iVar5 + 1;
puVar1 = (ushort *)(*(int *)(this + 0x80) + iVar11 + 6);
*puVar1 = *puVar1 | 0x40;
CDispCollTri::CalcPlane
((CDispCollTri *)(*(int *)(this + 0x80) + iVar11),(CDispVector *)(this + 0x70));
CDispCollTri::FindMinMax
((CDispCollTri *)(iVar11 + *(int *)(this + 0x80)),(CDispVector *)(this + 0x70));
} while (iVar5 < *(int *)(this + 0x88));
}
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.