L L4D2node

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 into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)