TesselateDisplacement_R<CEngineTesselateHelper>
0x00136a80 · 852 bytes · __cdecl
_Z23TesselateDisplacement_RI22CEngineTesselateHelperEvPT_RK10CVertIndexii
Decompiled
void (4 params)
/* void TesselateDisplacement_R<CEngineTesselateHelper>(CEngineTesselateHelper*, CVertIndex const&,
int, int) */
void TesselateDisplacement_R<CEngineTesselateHelper>
(CEngineTesselateHelper *param_1,CVertIndex *param_2,int param_3,int param_4)
{
CVertIndex *pCVar1;
undefined2 *puVar2;
short sVar3;
short sVar4;
int iVar5;
int iVar6;
int iVar7;
uint uVar8;
short *psVar9;
int iVar10;
int local_44;
int local_3c;
int local_34;
int local_30;
uint local_2c [7];
puVar2 = (undefined2 *)(param_3 * 0x1c + *(int *)(*(int *)(param_1 + 0x200) + 0x24c));
local_44 = *(int *)(param_1 + 8);
iVar5 = *(int *)(param_1 + 4);
if (param_4 < *(int *)(iVar5 + 0x1c) + -1) {
local_30 = param_3 + 1;
iVar6 = *(int *)(iVar5 + 0x24);
sVar3 = *(short *)param_2;
iVar7 = *(short *)(param_2 + 2) * iVar6;
iVar10 = 0;
while( true ) {
pCVar1 = (CVertIndex *)((iVar7 + sVar3) * 0x10 + *(int *)(iVar5 + 8) + iVar10 * 4);
iVar5 = (int)*(short *)pCVar1 + *(short *)(pCVar1 + 2) * iVar6;
uVar8 = 1 << ((byte)iVar5 & 0x1f) & *(uint *)(*(int *)param_1 + (iVar5 >> 5) * 4);
local_2c[iVar10] = uVar8;
if (uVar8 == 0) {
iVar5 = local_30 * 0x1c + *(int *)(*(int *)(param_1 + 0x200) + 0x24c);
*(undefined1 *)(iVar5 + 2) = 0;
*(undefined1 *)(iVar5 + 3) = 0;
}
else {
TesselateDisplacement_R<CEngineTesselateHelper>(param_1,pCVar1,local_30,param_4 + 1);
}
iVar5 = *(int *)(param_1 + 4);
iVar10 = iVar10 + 1;
local_30 = local_30 + *(int *)(iVar5 + 8 + (param_4 + 0xc) * 4);
if (iVar10 == 4) break;
iVar6 = *(int *)(iVar5 + 0x24);
}
if (local_44 != *(int *)(param_1 + 8)) {
*(undefined1 *)((int)puVar2 + 3) = 1;
local_44 = *(int *)(param_1 + 8);
goto LAB_00136ae6;
}
}
else {
local_2c[3] = 0;
local_2c[2] = 0;
local_2c[1] = 0;
local_2c[0] = 0;
}
*(undefined1 *)((int)puVar2 + 3) = 0;
LAB_00136ae6:
if (0 < DAT_0033c118) {
sVar3 = (short)(1 << (~(byte)param_4 + (char)*(undefined4 *)(*(int *)(param_1 + 4) + 0x1c) &
0x1f));
local_30 = 0;
local_3c = 0;
local_34 = 0;
do {
psVar9 = (short *)(g_TWinding + local_30);
if ((psVar9[2] == -1) || (local_2c[psVar9[2]] == 0)) {
iVar5 = *(int *)(param_1 + 4);
iVar6 = (int)(short)(*psVar9 * sVar3 + *(short *)param_2) +
(int)(short)(psVar9[1] * sVar3 + *(short *)(param_2 + 2)) * *(int *)(iVar5 + 0x24);
if ((*(uint *)(*(int *)param_1 + (iVar6 >> 5) * 4) & 1 << ((byte)iVar6 & 0x1f)) != 0) {
*(short *)(param_1 + local_3c * 2 + 0xc) = (short)iVar6;
if (local_3c == 1) {
*(short *)(param_1 + 0x10) =
*(short *)(param_2 + 2) * (short)*(undefined4 *)(iVar5 + 0x24) + *(short *)param_2;
sVar4 = (short)*(undefined4 *)(*(int *)(param_1 + 0x200) + 0x2c);
*(short *)(*(int *)(param_1 + 0xd8) + *(int *)(param_1 + 0xf8) * 2) =
sVar4 + *(short *)(param_1 + 0xf4) + *(short *)(param_1 + 0xc);
iVar5 = *(int *)(param_1 + 0xf8) + *(int *)(param_1 + 0xe4);
*(int *)(param_1 + 0xf8) = iVar5;
if (*(int *)(param_1 + 0xf0) < iVar5) {
*(int *)(param_1 + 0xf0) = iVar5;
}
*(short *)(*(int *)(param_1 + 0xd8) + iVar5 * 2) =
sVar4 + *(short *)(param_1 + 0xf4) + *(short *)(param_1 + 0xe);
iVar5 = *(int *)(param_1 + 0xf8) + *(int *)(param_1 + 0xe4);
*(int *)(param_1 + 0xf8) = iVar5;
if (*(int *)(param_1 + 0xf0) < iVar5) {
*(int *)(param_1 + 0xf0) = iVar5;
}
*(short *)(*(int *)(param_1 + 0xd8) + iVar5 * 2) =
sVar4 + *(short *)(param_1 + 0xf4) + *(short *)(param_1 + 0x10);
iVar5 = *(int *)(param_1 + 0xf8) + *(int *)(param_1 + 0xe4);
*(int *)(param_1 + 0xf8) = iVar5;
if (*(int *)(param_1 + 0xf0) < iVar5) {
*(int *)(param_1 + 0xf0) = iVar5;
}
*(short *)(*(int *)(*(int *)(param_1 + 0x200) + 0xf4) + *(int *)(param_1 + 8) * 2) =
sVar4 + *(short *)(param_1 + 0xc);
*(short *)(*(int *)(*(int *)(param_1 + 0x200) + 0xf4) + 2 + *(int *)(param_1 + 8) * 2) =
sVar4 + *(short *)(param_1 + 0xe);
*(short *)(*(int *)(*(int *)(param_1 + 0x200) + 0xf4) + 4 + *(int *)(param_1 + 8) * 2) =
sVar4 + *(short *)(param_1 + 0x10);
*(int *)(param_1 + 8) = *(int *)(param_1 + 8) + 3;
*(undefined2 *)(param_1 + 0xc) = *(undefined2 *)(param_1 + 0xe);
}
else {
local_3c = 1;
}
}
}
else {
local_3c = 0;
}
local_34 = local_34 + 1;
local_30 = local_30 + 6;
} while (local_34 < DAT_0033c118);
}
*(char *)(puVar2 + 1) = (char)*(undefined4 *)(param_1 + 8) - (char)local_44;
*puVar2 = (short)local_44;
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.