Mod_GetModelMaterials
0x00199f80 · 216 bytes · __cdecl
_Z21Mod_GetModelMaterialsP7model_tiPP9IMaterial
Decompiled
undefined (3 params)
/* Mod_GetModelMaterials(model_t*, int, IMaterial**) */
int Mod_GetModelMaterials(model_t *param_1,int param_2,IMaterial **param_3)
{
IMaterial *pIVar1;
undefined4 uVar2;
int iVar3;
int iVar4;
byte *pbVar5;
int iVar6;
if (*(int *)(param_1 + 0x110) == 1) {
if (0 < *(int *)(param_1 + 0x13c)) {
iVar4 = 0;
iVar3 = 0;
do {
pbVar5 = (byte *)((*(int *)(param_1 + 0x138) + iVar4) * 0x20 +
*(int *)(*(int *)(param_1 + 0x134) + 0x78));
if ((*pbVar5 & 0x10) == 0) {
pIVar1 = *(IMaterial **)
((uint)(*(ushort *)(pbVar5 + 0x16) >> 1) * 0x50 +
*(int *)(*(int *)(param_1 + 0x134) + 0x5c) + 0x4c);
iVar6 = iVar3;
do {
iVar6 = iVar6 + -1;
if (iVar6 < 0) {
param_3[iVar3] = pIVar1;
iVar3 = iVar3 + 1;
break;
}
} while (param_3[iVar6] != pIVar1);
if (param_2 <= iVar3) {
return iVar3;
}
}
iVar4 = iVar4 + 1;
if (*(int *)(param_1 + 0x13c) <= iVar4) {
return iVar3;
}
} while( true );
}
}
else if (*(int *)(param_1 + 0x110) == 3) {
uVar2 = (**(code **)(*g_pMDLCache + 0x28))(g_pMDLCache,*(undefined2 *)(param_1 + 0x134));
iVar3 = (**(code **)(*g_pStudioRender + 0xa0))(g_pStudioRender,uVar2,param_2,param_3);
return iVar3;
}
return 0;
}
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.