FindNeighboringDispSurfs
0x000d33a0 · 380 bytes · __cdecl
_Z24FindNeighboringDispSurfsPP13CCoreDispInfoi
Decompiled
undefined (2 params)
/* FindNeighboringDispSurfs(CCoreDispInfo**, int) */
void FindNeighboringDispSurfs(CCoreDispInfo **param_1,int param_2)
{
CCoreDispInfo **ppCVar1;
float *pfVar2;
float fVar3;
CCoreDispInfo *pCVar4;
CCoreDispInfo *pCVar5;
int iVar6;
int iVar7;
int iVar8;
int iVar9;
int local_50;
int local_4c;
int local_40;
int local_34;
int local_30 [8];
iVar8 = 0;
if (0 < param_2) {
do {
ppCVar1 = param_1 + iVar8;
iVar8 = iVar8 + 1;
ClearNeighborData(*ppCVar1);
} while (iVar8 != param_2);
}
local_30[0] = 0;
local_30[1] = 0;
local_30[2] = 0;
local_30[3] = 0;
local_30[4] = 0;
/* try { // try from 000d33ff to 000d34f0 has its CatchHandler @ 000d351c */
SetupDispBoxes(param_1,param_2,(CUtlVector *)local_30);
local_34 = 0;
local_50 = 0x18;
local_4c = 0;
if (0 < param_2) {
while( true ) {
iVar8 = local_4c + 1;
pCVar4 = param_1[local_4c];
if (iVar8 == param_2) break;
local_40 = local_50;
iVar9 = iVar8;
do {
pCVar5 = param_1[iVar9];
iVar7 = local_30[0] + local_50 + -0x18;
iVar6 = 0;
do {
fVar3 = *(float *)(local_30[0] + local_40 + iVar6 * 4);
pfVar2 = (float *)(iVar7 + 0xc + iVar6 * 4);
if ((*pfVar2 <= fVar3 && fVar3 != *pfVar2) ||
(fVar3 = *(float *)(iVar7 + iVar6 * 4),
pfVar2 = (float *)(local_30[0] + local_40 + 0xc + iVar6 * 4),
*pfVar2 <= fVar3 && fVar3 != *pfVar2)) goto LAB_000d34b3;
iVar6 = iVar6 + 1;
} while (iVar6 != 3);
SetupEdgeNeighbors(pCVar4,pCVar5);
SetupCornerNeighbors(pCVar4,pCVar5,&local_34);
LAB_000d34b3:
local_40 = local_40 + 0x18;
iVar9 = iVar9 + 1;
} while (iVar9 != param_2);
local_50 = local_50 + 0x18;
local_4c = iVar8;
}
if (local_34 != 0) {
Warning("Warning: overflowed %d displacement corner-neighbor lists.",local_34);
}
}
VerifyNeighborConnections(param_1,param_2);
local_30[3] = 0;
CUtlMemory<CDispBox,int>::Purge((CUtlMemory<CDispBox,int> *)local_30);
local_30[4] = local_30[0];
CUtlMemory<CDispBox,int>::Purge((CUtlMemory<CDispBox,int> *)local_30);
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.