CModelRender::ValidateStaticPropColorData
0x00189880 · 525 bytes · __thiscall
_ZN12CModelRender27ValidateStaticPropColorDataEt
Decompiled
undefined (2 params)
/* CModelRender::ValidateStaticPropColorData(unsigned short) */
void __thiscall CModelRender::ValidateStaticPropColorData(CModelRender *this,ushort param_1)
{
char cVar1;
undefined4 uVar2;
int *piVar3;
int iVar4;
undefined4 *puVar5;
int in_GS_OFFSET;
int *local_15c [14];
char local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (*(int *)(r_proplightingfromdisk._28_4_ + 0x30) != 0) {
puVar5 = (undefined4 *)((uint)param_1 * 0x108 + *(int *)(this + 0xc));
uVar2 = (*(code *)**(undefined4 **)*puVar5)((undefined4 *)*puVar5);
piVar3 = (int *)StaticPropMgr();
cVar1 = (**(code **)(*piVar3 + 0x28))(piVar3,uVar2);
if ((cVar1 != '\0') && (g_bLoadedMapHasBakedPropLighting != '\0')) {
piVar3 = (int *)StaticPropMgr();
cVar1 = (**(code **)(*piVar3 + 0x34))(piVar3,uVar2);
if (cVar1 == '\0') {
CUtlBuffer::CUtlBuffer((CUtlBuffer *)local_15c,0,0,0);
/* try { // try from 00189944 to 00189a5a has its CatchHandler @ 00189a96 */
iVar4 = (**(code **)(*g_pMaterialSystemHardwareConfig + 0x8c))
(g_pMaterialSystemHardwareConfig);
if ((iVar4 == 0) || (g_bBakedPropLightingNoSeparateHDR != '\0')) {
piVar3 = (int *)StaticPropMgr();
uVar2 = (**(code **)(*piVar3 + 0x30))(piVar3,uVar2);
V_snprintf(local_124,0x104,"sp_%d%s.vhv",uVar2,&DAT_002c79d4);
}
else {
piVar3 = (int *)StaticPropMgr();
uVar2 = (**(code **)(*piVar3 + 0x30))(piVar3,uVar2);
V_snprintf(local_124,0x104,"sp_hdr_%d%s.vhv",uVar2,&DAT_002c79d4);
}
cVar1 = (**(code **)(*(int *)(g_pFileSystem + 4) + 0x38))
(g_pFileSystem + 4,local_124,&DAT_002a076d,(CUtlBuffer *)local_15c,0x28,0,
0);
if (cVar1 != '\0') {
iVar4 = (**(code **)(*g_pMDLCache + 0x28))(g_pMDLCache,*(undefined2 *)(puVar5[1] + 0x134))
;
if (((*local_15c[0] == 2) && (local_15c[0][1] == *(int *)(iVar4 + 8))) &&
(local_15c[0][3] == *(int *)(r_staticlight_streams._28_4_ + 0x30) << 2)) {
*(ushort *)((int)puVar5 + 0xfa) = *(ushort *)((int)puVar5 + 0xfa) & 0xfffb | 2;
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_15c);
goto LAB_001898a9;
}
*(ushort *)((int)puVar5 + 0xfa) = *(ushort *)((int)puVar5 + 0xfa) | 4;
}
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_15c);
}
}
}
LAB_001898a9:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.