Mod_LoadSurfaceLightingV1
0x001972d0 · 134 bytes · __cdecl
_Z25Mod_LoadSurfaceLightingV1P18msurfacelighting_tP7dface_tP13ColorRGBExp32
Decompiled
undefined (3 params)
/* Mod_LoadSurfaceLightingV1(msurfacelighting_t*, dface_t*, ColorRGBExp32*) */
bool Mod_LoadSurfaceLightingV1(msurfacelighting_t *param_1,dface_t *param_2,ColorRGBExp32 *param_3)
{
msurfacelighting_t mVar1;
*(short *)(param_1 + 4) = (short)*(undefined4 *)(param_2 + 0x24);
*(short *)(param_1 + 6) = (short)*(undefined4 *)(param_2 + 0x28);
*(short *)param_1 = (short)*(undefined4 *)(param_2 + 0x1c);
*(short *)(param_1 + 2) = (short)*(undefined4 *)(param_2 + 0x20);
if ((param_3 == (ColorRGBExp32 *)0x0) || (*(int *)(param_2 + 0x14) == -1)) {
*(undefined4 *)(param_1 + 0x1c) = 0;
param_1[0x18] = (msurfacelighting_t)0xff;
param_1[0x19] = (msurfacelighting_t)0xff;
param_1[0x1a] = (msurfacelighting_t)0xff;
param_1[0x1b] = (msurfacelighting_t)0xff;
}
else {
*(ColorRGBExp32 **)(param_1 + 0x1c) = param_3 + *(int *)(param_2 + 0x14);
mVar1 = *(msurfacelighting_t *)(param_2 + 0x10);
param_1[0x18] = mVar1;
param_1[0x19] = *(msurfacelighting_t *)(param_2 + 0x11);
param_1[0x1a] = *(msurfacelighting_t *)(param_2 + 0x12);
param_1[0x1b] = *(msurfacelighting_t *)(param_2 + 0x13);
if ((byte)((char)mVar1 - 1U) < 0xfe) {
return true;
}
}
return param_1[0x19] != (msurfacelighting_t)0xff;
}
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.