BuildTagData
0x0013a200 · 369 bytes · __cdecl
_Z12BuildTagDataP13CCoreDispInfoP9CDispInfo
Decompiled
undefined (2 params)
/* BuildTagData(CCoreDispInfo*, CDispInfo*) */
void BuildTagData(CCoreDispInfo *param_1,CDispInfo *param_2)
{
ushort uVar1;
int iVar2;
uint uVar3;
void *pvVar4;
int iVar5;
int iVar6;
int local_24;
int local_20;
iVar6 = 0;
local_20 = 0;
for (iVar5 = 0; iVar2 = CCoreDispInfo::GetTriCount(param_1), iVar5 < iVar2; iVar5 = iVar5 + 1) {
uVar1 = *(ushort *)(*(int *)(param_1 + 0x1bc) + 6 + iVar5 * 8);
local_20 = (local_20 + 1) - (uint)((uVar1 & 2) == 0);
iVar6 = (iVar6 + 1) - (uint)((uVar1 & 4) == 0);
}
uVar3 = local_20 * 6;
if (0x3f800000 < (uint)(local_20 * 3)) {
uVar3 = 0xffffffff;
}
pvVar4 = operator_new__(uVar3);
*(void **)(param_2 + 0x240) = pvVar4;
uVar3 = 0xffffffff;
if ((uint)(iVar6 * 3) < 0x3f800001) {
uVar3 = iVar6 * 6;
}
pvVar4 = operator_new__(uVar3);
local_24 = 0;
local_20 = 0;
*(void **)(param_2 + 0x248) = pvVar4;
for (iVar5 = 0; iVar6 = CCoreDispInfo::GetTriCount(param_1), iVar5 < iVar6; iVar5 = iVar5 + 1) {
uVar1 = *(ushort *)(*(int *)(param_1 + 0x1bc) + 6 + iVar5 * 8);
if ((uVar1 & 2) != 0) {
iVar2 = *(int *)(param_2 + 0x240);
iVar6 = local_20 * 2 + 4;
CCoreDispInfo::GetTriIndices
(param_1,iVar5,(ushort *)(iVar2 + -4 + iVar6),(ushort *)(iVar2 + -2 + iVar6),
(ushort *)(iVar2 + iVar6));
local_20 = local_20 + 3;
uVar1 = *(ushort *)(*(int *)(param_1 + 0x1bc) + 6 + iVar5 * 8);
}
if ((uVar1 & 4) != 0) {
iVar2 = *(int *)(param_2 + 0x248);
iVar6 = local_24 * 2 + 4;
CCoreDispInfo::GetTriIndices
(param_1,iVar5,(ushort *)(iVar2 + -4 + iVar6),(ushort *)(iVar2 + -2 + iVar6),
(ushort *)(iVar2 + iVar6));
local_24 = local_24 + 3;
}
}
*(int *)(param_2 + 0x23c) = local_20;
*(int *)(param_2 + 0x244) = local_24;
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.