L L4D2node

CDispInfo::NotifyAddDecal

0x001384c0 · 387 bytes · __thiscall

_ZN9CDispInfo14NotifyAddDecalEP7decal_tf

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CDispInfo::NotifyAddDecal(decal_t*, float) */

uint __thiscall CDispInfo::NotifyAddDecal(CDispInfo *this,decal_t *param_1,float param_2)

{
  ushort uVar1;
  ushort uVar2;
  int iVar3;
  ushort uVar4;
  uint uVar5;
  undefined4 *puVar6;
  int iVar7;
  CDispDecalBase *pCVar8;
  CDecalVert *local_20 [4];
  
  uVar5 = CUtlLinkedList<CDispDecal,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDispDecal,unsigned_short>,unsigned_short>>
          ::AllocInternal((CUtlLinkedList<CDispDecal,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDispDecal,unsigned_short>,unsigned_short>>
                           *)&s_DispDecals,true);
  uVar4 = (ushort)uVar5;
  if (uVar4 != 0xffff) {
    iVar7 = (uVar5 & 0xffff) * 0x50;
    puVar6 = (undefined4 *)(iVar7 + s_DispDecals);
    if (puVar6 != (undefined4 *)0x0) {
      *puVar6 = 0;
      puVar6[1] = 0;
      puVar6[2] = 0;
      *(undefined1 *)(puVar6 + 3) = 0;
    }
    uVar1 = *(ushort *)(this + 0x25e);
    CUtlLinkedList<CDispDecal,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDispDecal,unsigned_short>,unsigned_short>>
    ::Unlink((CUtlLinkedList<CDispDecal,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDispDecal,unsigned_short>,unsigned_short>>
              *)&s_DispDecals,uVar4);
    iVar3 = s_DispDecals;
    pCVar8 = (CDispDecalBase *)(iVar7 + s_DispDecals);
    *(ushort *)(pCVar8 + 0x4e) = uVar1;
    uVar2 = DAT_0039ec82;
    if (uVar1 == 0xffff) {
      uVar1 = uVar4;
      *(ushort *)(pCVar8 + 0x4c) = DAT_0039ec82;
      DAT_0039ec82 = uVar1;
    }
    else {
      iVar7 = (uint)uVar1 * 0x50 + iVar3;
      uVar2 = *(ushort *)(iVar7 + 0x4c);
      *(ushort *)(pCVar8 + 0x4c) = uVar2;
      *(ushort *)(iVar7 + 0x4c) = uVar4;
    }
    uVar1 = uVar4;
    if (uVar2 != 0xffff) {
      *(ushort *)(iVar3 + 0x4e + (uint)uVar2 * 0x50) = uVar4;
      uVar1 = _DAT_0039ec80;
    }
    _DAT_0039ec80 = uVar1;
    *(ushort *)(this + 0x25e) = uVar4;
    local_20[0] = (CDecalVert *)0x0;
    _DAT_0039ec86 = _DAT_0039ec86 + 1;
    *(undefined2 *)(pCVar8 + 0xe) = 0;
    *(undefined2 *)(pCVar8 + 0x10) = 0;
    *(decal_t **)(pCVar8 + 0x14) = param_1;
    *(undefined2 *)(pCVar8 + 0x48) = 0xffff;
    *(float *)(pCVar8 + 0x44) = param_2;
    R_SetupDecalClip(local_20,param_1,*(Vector **)(*(int *)(this + 0x16c) + 4),
                     *(IMaterial **)(param_1 + 0xc),(Vector *)(pCVar8 + 0x20),
                     (float *)(pCVar8 + 0x18));
    SetupDecalNodeIntersect
              (this,(CVertIndex *)(*(int *)(this + 0x1dc) + 0x20),0,pCVar8,(ShadowInfo_t *)0x0);
  }
  return uVar5;
}

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)