DispInfo_CreateMaterialGroups
0x0013a3c0 · 530 bytes · __cdecl
_Z29DispInfo_CreateMaterialGroupsP7model_tPK25MaterialSystem_SortInfo_t
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* DispInfo_CreateMaterialGroups(model_t*, MaterialSystem_SortInfo_t const*) */
void DispInfo_CreateMaterialGroups(model_t *param_1,MaterialSystem_SortInfo_t *param_2)
{
int iVar1;
int *piVar2;
int iVar3;
int iVar4;
int local_20 [4];
local_20[0] = 0;
iVar3 = *(int *)(param_1 + 0x134);
if (0 < *(int *)(iVar3 + 0x68)) {
do {
iVar1 = DispInfo_IndexArray(*(void **)(iVar3 + 0x6c),local_20[0]);
iVar3 = *(int *)(param_2 + *(short *)(*(int *)(iVar1 + 0x16c) + 0x12) * 8 + 4);
iVar1 = *(int *)((uint)(*(ushort *)(*(int *)(iVar1 + 0x16c) + 0x16) >> 1) * 0x50 +
*(int *)(DAT_003a172c + 0x5c) + 0x4c);
if (0 < DAT_0039eb58) {
iVar4 = 0;
do {
piVar2 = *(int **)((int)g_DispGroups + iVar4 * 4);
if ((iVar3 == *piVar2) && (iVar1 == piVar2[1])) goto LAB_0013a453;
iVar4 = iVar4 + 1;
} while (iVar4 != DAT_0039eb58);
}
piVar2 = operator_new(0x34);
*piVar2 = iVar3;
piVar2[2] = 0;
piVar2[3] = 0;
piVar2[1] = iVar1;
iVar1 = DAT_0039eb58;
piVar2[4] = 0;
piVar2[5] = 0;
piVar2[6] = 0;
piVar2[7] = 0;
piVar2[8] = 0;
iVar3 = iVar1 + 1;
piVar2[9] = 0;
piVar2[10] = 0;
piVar2[0xb] = 0;
piVar2[0xc] = 0;
if ((DAT_0039eb50 < iVar3) && (-1 < DAT_0039eb54)) {
if (DAT_0039eb54 == 0) {
if ((DAT_0039eb50 != 0) || (DAT_0039eb50 = 8, iVar4 = DAT_0039eb50, 8 < iVar3)) {
do {
iVar4 = DAT_0039eb50 * 2;
if (iVar3 <= DAT_0039eb50 * 2) break;
DAT_0039eb50 = DAT_0039eb50 * 4;
iVar4 = DAT_0039eb50;
} while (DAT_0039eb50 < iVar3);
}
}
else {
for (iVar4 = (iVar1 / DAT_0039eb54 + 1) * DAT_0039eb54; iVar4 < iVar3;
iVar4 = (iVar4 + iVar3) / 2) {
}
}
DAT_0039eb50 = iVar4;
if (g_DispGroups == (void *)0x0) {
g_DispGroups = malloc(iVar4 << 2);
}
else {
g_DispGroups = realloc(g_DispGroups,iVar4 << 2);
iVar3 = DAT_0039eb58 + 1;
}
}
iVar4 = iVar1 * 4;
iVar1 = (iVar3 - iVar1) + -1;
DAT_0039eb58 = iVar3;
_DAT_0039eb5c = g_DispGroups;
if (0 < iVar1) {
_V_memmove((void *)((int)g_DispGroups + iVar4 + 4),(void *)((int)g_DispGroups + iVar4),
iVar1 * 4);
}
if ((undefined4 *)((int)g_DispGroups + iVar4) != (undefined4 *)0x0) {
*(undefined4 *)((int)g_DispGroups + iVar4) = piVar2;
}
LAB_0013a453:
CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
((CUtlVector<int,CUtlMemory<int,int>> *)(piVar2 + 7),piVar2[10],local_20);
iVar3 = *(int *)(param_1 + 0x134);
local_20[0] = local_20[0] + 1;
} while (local_20[0] < *(int *)(iVar3 + 0x68));
}
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.