CModelRender::StaticPropColorMeshCallback
0x001889c0 · 1194 bytes · __thiscall
_ZN12CModelRender27StaticPropColorMeshCallbackEPvPKvi15FSAsyncStatus_t
Decompiled
undefined (5 params)
/* CModelRender::StaticPropColorMeshCallback(void*, void const*, int, FSAsyncStatus_t) */
void __thiscall
CModelRender::StaticPropColorMeshCallback
(CModelRender *this,undefined4 *param_1,int param_2,undefined4 param_3,int param_5)
{
ushort *puVar1;
int iVar2;
int iVar3;
int *piVar4;
undefined4 *puVar5;
int iVar6;
int iVar7;
void *pvVar8;
int *piVar9;
int iVar10;
undefined4 *puVar11;
byte bVar12;
int local_21c;
int *local_218;
int local_210;
undefined4 local_204 [39];
int local_168;
int local_164;
int local_160;
int local_154;
int *local_150;
undefined4 local_14c;
char local_148;
int local_144;
int local_138;
int *local_134;
int local_130;
int local_12c;
int local_128;
int local_124;
undefined4 local_120;
undefined4 local_11c;
undefined4 local_118;
undefined1 local_114;
undefined4 local_110 [19];
undefined4 local_c4;
uint local_c0;
undefined4 local_bc;
void *local_b0;
undefined4 local_ac;
void *local_a8;
undefined4 local_a4 [8];
undefined4 local_84 [6];
int *local_6c;
undefined1 local_68;
int local_64;
int local_60;
undefined4 local_5c;
undefined4 local_58;
void *local_54;
undefined4 local_50;
undefined4 local_4c [8];
undefined4 local_2c;
int local_28;
int local_24;
bVar12 = 0;
if ((param_5 == 0) && (0 < *(int *)(param_2 + 0x14))) {
if (*(int *)(param_2 + 0x28) == param_1[3]) {
local_210 = 0;
piVar9 = (int *)(param_2 + 0x28);
}
else {
local_210 = 0;
piVar4 = (int *)(param_2 + 0x44);
do {
piVar9 = piVar4;
local_210 = local_210 + 1;
if (local_210 == *(int *)(param_2 + 0x14)) goto LAB_00188a11;
piVar4 = piVar9 + 7;
} while (*piVar9 != param_1[3]);
}
iVar2 = *(int *)(r_staticlight_streams._28_4_ + 0x30);
iVar7 = param_1[1];
iVar10 = *(int *)(*(int *)(iVar7 + 4) + 0xc);
if (iVar10 == piVar9[1]) {
local_21c = 0x10;
iVar6 = 0;
local_218 = (int *)(param_2 + 0x28 + (local_210 + 1) * 0x1c);
do {
local_148 = '\0';
local_134 = (int *)0x0;
local_130 = 0;
local_12c = 0;
iVar3 = piVar9[2];
local_124 = 0;
local_120 = 0;
local_11c = 0xffffffff;
local_118 = 0;
local_6c = (int *)0x0;
local_28 = -1;
local_24 = 0;
local_60 = 0;
local_5c = 0;
local_64 = 0;
local_2c = 0;
local_c4 = 0xffffffff;
piVar9 = *(int **)(*(int *)(iVar7 + 4) + iVar6);
local_14c = 10;
/* try { // try from 00188b61 to 00188e5a has its CatchHandler @ 00188e75 */
local_150 = piVar9;
(**(code **)(*piVar9 + 0x30))(piVar9,10);
(**(code **)(*local_150 + 0x4c))(local_150,iVar10,0,local_204);
local_6c = piVar9;
local_64 = iVar10;
local_134 = piVar9 + 1;
puVar5 = local_204;
puVar11 = local_110;
for (iVar7 = 0x29; iVar7 != 0; iVar7 = iVar7 + -1) {
*puVar11 = *puVar5;
puVar5 = puVar5 + (uint)bVar12 * -2 + 1;
puVar11 = puVar11 + (uint)bVar12 * -2 + 1;
}
local_68 = 0;
local_12c = 0;
local_144 = local_160;
local_130 = 0;
local_114 = 0;
local_128 = local_168;
local_138 = local_154;
local_124 = 0;
local_60 = 0;
local_c0 = ~-(uint)(local_c0 == 0) & 2;
if (local_28 == -1) {
local_2c = 0;
local_24 = local_168;
local_28 = local_164;
}
local_5c = 0;
local_58 = local_bc;
local_54 = local_b0;
puVar5 = local_a4;
do {
puVar11 = puVar5 + 1;
puVar5[0x16] = *puVar5;
puVar5 = puVar11;
} while (puVar11 != local_84);
local_50 = local_ac;
pvVar8 = local_b0;
if (iVar2 < 2) {
pvVar8 = local_a8;
}
_V_memcpy(pvVar8,(void *)(param_2 + iVar3),iVar10 * 4 * iVar2);
if (local_148 != '\0') {
switch(local_14c) {
case 4:
iVar7 = local_60 * 2 + -2;
break;
case 5:
iVar7 = local_60 * 2;
break;
case 6:
iVar7 = local_60 * 3 + -6;
break;
case 7:
iVar10 = local_60 * 6;
iVar7 = iVar10 + 3;
if (-1 < iVar10) {
iVar7 = iVar10;
}
iVar7 = iVar7 >> 2;
if (local_138 == 0) goto LAB_00188caa;
goto LAB_00188d44;
default:
iVar7 = local_60;
break;
case 9:
iVar7 = 0;
}
if (local_138 != 0) {
LAB_00188d44:
if (local_130 - local_124 < iVar7) {
iVar7 = local_130 - local_124;
}
if (iVar7 != 0) {
puVar1 = (ushort *)(local_144 + local_124 * 2);
switch(local_14c) {
case 0:
case 9:
break;
default:
GenerateSequentialIndexBuffer(puVar1,iVar7,local_128);
break;
case 4:
GenerateLineStripIndexBuffer(puVar1,iVar7,local_128);
break;
case 5:
GenerateLineLoopIndexBuffer(puVar1,iVar7,local_128);
break;
case 6:
GeneratePolygonIndexBuffer(puVar1,(int)puVar1,iVar7);
break;
case 7:
GenerateQuadIndexBuffer(puVar1,iVar7,local_128);
}
local_124 = local_124 + local_138 * iVar7;
if (local_12c < local_124) {
local_12c = local_124;
}
}
}
}
LAB_00188caa:
(**(code **)(*local_150 + 0x58))(local_150,local_60,local_12c,local_204);
local_210 = local_210 + 1;
if (*(int *)(param_2 + 0x14) <= local_210) goto LAB_00188a11;
iVar7 = param_1[1];
iVar10 = *(int *)(*(int *)(iVar7 + 4) + 0xc + local_21c);
piVar4 = local_218 + 1;
iVar6 = local_21c;
piVar9 = local_218;
local_21c = local_21c + 0x10;
local_218 = local_218 + 7;
} while (iVar10 == *piVar4);
}
}
else {
LAB_00188a11:
iVar7 = param_1[1];
}
*(byte *)(iVar7 + 0x14) = *(byte *)(iVar7 + 0x14) | 2;
(**(code **)(**(int **)(this + 8) + 0x2c))(*(int **)(this + 8),*param_1);
operator_delete(param_1);
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.