ComputeDecalLightmapOffset
0x001dac70 · 152 bytes · __cdecl
_Z26ComputeDecalLightmapOffsetP11msurface2_t
Decompiled
undefined (1 param)
/* ComputeDecalLightmapOffset(msurface2_t*) */
longdouble ComputeDecalLightmapOffset(msurface2_t *param_1)
{
code *pcVar1;
undefined4 uVar2;
int local_14;
undefined1 local_10 [4];
if (((byte)*param_1 & 8) != 0) {
pcVar1 = *(code **)(*materials + 0x174);
uVar2 = SortInfoToLightmapPage((int)*(short *)(param_1 + 0x12));
(*pcVar1)(materials,uVar2,&local_14,local_10);
if (local_14 != 0) {
return (longdouble)
((float)(*(short *)(((int)param_1 - *(int *)(DAT_003a172c + 0x78) & 0xffffffe0U) +
*(int *)(DAT_003a172c + 0x7c) + 4) + 1) / (float)local_14);
}
}
return (longdouble)0.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.