CModelRender::EngineLightingToMaterialLighting
0x00187070 · 221 bytes · __thiscall
_ZN12CModelRender32EngineLightingToMaterialLightingEP23MaterialLightingState_tRK6VectorRK15LightingState_t
Decompiled
undefined (4 params)
/* CModelRender::EngineLightingToMaterialLighting(MaterialLightingState_t*, Vector const&,
LightingState_t const&) */
void __thiscall
CModelRender::EngineLightingToMaterialLighting
(CModelRender *this,MaterialLightingState_t *param_1,Vector *param_2,
LightingState_t *param_3)
{
LightDesc_t *pLVar1;
char cVar2;
int iVar3;
LightingState_t *pLVar4;
MaterialLightingState_t *pMVar5;
int iVar6;
float fVar7;
pLVar4 = param_3;
pMVar5 = param_1;
for (iVar3 = 0x12; iVar3 != 0; iVar3 = iVar3 + -1) {
*(undefined4 *)pMVar5 = *(undefined4 *)pLVar4;
pLVar4 = pLVar4 + 4;
pMVar5 = pMVar5 + 4;
}
*(undefined4 *)(param_1 + 0x48) = *(undefined4 *)param_2;
*(undefined4 *)(param_1 + 0x4c) = *(undefined4 *)(param_2 + 4);
*(undefined4 *)(param_1 + 0x50) = *(undefined4 *)(param_2 + 8);
if (*(int *)(param_3 + 0x48) < 1) {
iVar3 = 0;
}
else {
iVar6 = 0;
iVar3 = 0;
do {
pLVar1 = (LightDesc_t *)(param_1 + iVar3 * 0x58 + 0x58);
cVar2 = WorldLightToMaterialLight(*(dworldlight_t **)(param_3 + iVar6 * 4 + 0x4c),pLVar1);
if (cVar2 != '\0') {
iVar3 = iVar3 + 1;
fVar7 = (float)*(int *)(d_lightstylevalue +
*(int *)(*(int *)(param_3 + iVar6 * 4 + 0x4c) + 0x38) * 4) *
0.003787879;
*(float *)(pLVar1 + 4) = *(float *)(pLVar1 + 4) * fVar7;
*(float *)(pLVar1 + 8) = *(float *)(pLVar1 + 8) * fVar7;
*(float *)(pLVar1 + 0xc) = fVar7 * *(float *)(pLVar1 + 0xc);
if (3 < iVar3) break;
}
iVar6 = iVar6 + 1;
} while (iVar6 < *(int *)(param_3 + 0x48));
}
*(int *)(param_1 + 0x54) = iVar3;
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.