CModelLoader::DumpVCollideStats
0x0019cc40 · 606 bytes · __thiscall
_ZN12CModelLoader17DumpVCollideStatsEv
Decompiled
undefined (1 param)
/* CModelLoader::DumpVCollideStats() */
void __thiscall CModelLoader::DumpVCollideStats(CModelLoader *this)
{
char cVar1;
ushort *puVar2;
int iVar3;
undefined4 *puVar4;
int iVar5;
int iVar6;
int iVar7;
int iVar8;
int local_44;
int local_40;
int local_3c;
int local_38;
undefined4 local_34;
undefined4 local_30;
int local_2c;
int local_28;
undefined4 local_24;
undefined1 local_20;
local_38 = 0;
local_34 = 0;
local_30 = 0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = 0;
iVar5 = *(ushort *)(this + 0x16) - 1;
iVar7 = iVar5 * 0x10;
for (; iVar5 != -1; iVar5 = iVar5 + -1) {
iVar8 = *(int *)(*(int *)(this + 8) + 0xc + iVar7);
if ((iVar8 != 0) && (*(int *)(iVar8 + 0x110) == 3)) {
local_44 = 0;
/* try { // try from 0019ccd5 to 0019ce93 has its CatchHandler @ 0019cea7 */
cVar1 = (**(code **)(*g_pMDLCache + 0x7c))
(g_pMDLCache,*(undefined2 *)(iVar8 + 0x134),&local_44);
if ((cVar1 != '\0') && (local_44 != 0)) {
local_3c = local_44;
local_40 = iVar8 + 4;
CUtlSortVector<modelsize_t,CModelsize_Less>::Insert
((CUtlSortVector<modelsize_t,CModelsize_Less> *)&local_38,(modelsize_t *)&local_40
);
}
}
iVar7 = iVar7 + -0x10;
}
iVar7 = iVar5 * 0x14c;
iVar8 = *(int *)(this + 0x5c);
for (iVar5 = *(int *)(this + 0x5c) + -1; -1 < iVar5; iVar5 = iVar5 + -1) {
puVar2 = (ushort *)CM_VCollideForModel(iVar8,(model_t *)(iVar7 + *(int *)(this + 0x50)));
if (puVar2 != (ushort *)0x0) {
if ((*puVar2 & 0x7fff) == 0) {
iVar8 = 0;
}
else {
iVar6 = 0;
iVar8 = 0;
do {
iVar3 = (**(code **)(*physcollision + 0x48))
(physcollision,*(undefined4 *)(*(int *)(puVar2 + 2) + iVar6 * 4));
iVar8 = iVar8 + iVar3;
iVar6 = iVar6 + 1;
} while (iVar6 < (int)(*puVar2 & 0x7fff));
}
if ((uint)puVar2[1] + iVar8 != 0) {
local_40 = iVar7 + *(int *)(this + 0x50) + 4;
local_3c = (uint)puVar2[1] + iVar8;
CUtlSortVector<modelsize_t,CModelsize_Less>::Insert
((CUtlSortVector<modelsize_t,CModelsize_Less> *)&local_38,(modelsize_t *)&local_40
);
}
}
iVar7 = iVar7 + -0x14c;
iVar8 = iVar5;
}
Msg("VCollides loaded: %d\n",local_2c);
if (local_2c < 1) {
iVar5 = 0;
}
else {
iVar5 = 0;
iVar7 = 0;
do {
iVar8 = iVar7 * 8;
puVar4 = (undefined4 *)(local_38 + iVar8);
Msg("%8d bytes:%s\n",puVar4[1],*puVar4);
iVar7 = iVar7 + 1;
iVar5 = iVar5 + *(int *)(local_38 + 4 + iVar8);
} while (iVar7 < local_2c);
}
(**(code **)(*physcollision + 200))(physcollision,&local_40,&local_44);
Msg("%8d bytes BBox physics: %d boxes\n",local_40,local_44);
Msg("--------------\n%8d bytes total VCollide Memory\n",iVar5 + local_40);
local_2c = 0;
CUtlMemory<modelsize_t,int>::Purge((CUtlMemory<modelsize_t,int> *)&local_38);
local_28 = local_38;
CUtlMemory<modelsize_t,int>::Purge((CUtlMemory<modelsize_t,int> *)&local_38);
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.