L L4D2node

COverlayMgr::Surf_PreClipFragment

0x001d2620 · 386 bytes · __thiscall

_ZN11COverlayMgr20Surf_PreClipFragmentEP10moverlay_tR18moverlayfragment_tP11msurface2_tS3_

Decompiled

undefined (5 params)

/* COverlayMgr::Surf_PreClipFragment(moverlay_t*, moverlayfragment_t&, msurface2_t*,
   moverlayfragment_t&) */

undefined4 __thiscall
COverlayMgr::Surf_PreClipFragment
          (COverlayMgr *this,moverlay_t *param_1,moverlayfragment_t *param_2,msurface2_t *param_3,
          moverlayfragment_t *param_4)

{
  Vector *pVVar1;
  int iVar3;
  Vector *pVVar4;
  int iVar5;
  undefined4 *puVar6;
  int iVar2;
  
  *(undefined4 *)(param_2 + 0x1c) = 0;
  CUtlVector<overlayvert_t,CUtlMemory<overlayvert_t,int>>::GrowVector
            ((CUtlVector<overlayvert_t,CUtlMemory<overlayvert_t,int>> *)(param_2 + 0x10),4);
  CUtlVector<overlayvert_t,CUtlMemory<overlayvert_t,int>>::ShiftElementsRight
            ((CUtlVector<overlayvert_t,CUtlMemory<overlayvert_t,int>> *)(param_2 + 0x10),0,4);
  iVar2 = *(int *)(param_2 + 0x10);
  iVar5 = 0;
  do {
    puVar6 = (undefined4 *)(iVar2 + iVar5);
    if (puVar6 != (undefined4 *)0x0) {
      *puVar6 = 0;
      puVar6[1] = 0;
      puVar6[2] = 0;
      puVar6[3] = 0;
      puVar6[4] = 0;
      puVar6[5] = 0;
      puVar6[6] = 0;
      puVar6[7] = 0;
      puVar6[8] = 0;
      puVar6[9] = 0;
      puVar6[0xb] = 0;
      puVar6[10] = 0;
      puVar6[0xc] = 0xffffffff;
      iVar2 = *(int *)(param_2 + 0x10);
    }
    iVar5 = iVar5 + 0x34;
  } while (iVar5 != 0xd0);
  iVar5 = 0;
  pVVar4 = (Vector *)(param_1 + 0x30);
  while( true ) {
    pVVar1 = (Vector *)(iVar2 + iVar5);
    iVar5 = iVar5 + 0x34;
    Overlay_OverlayUVToOverlayPlane
              ((Vector *)(param_1 + 0x60),(Vector *)(param_1 + 0x6c),(Vector *)(param_1 + 0x78),
               pVVar4,pVVar1);
    if (iVar5 == 0xd0) break;
    iVar2 = *(int *)(param_2 + 0x10);
    pVVar4 = pVVar4 + 0xc;
  }
  InitTexCoords(this,param_1,param_2);
  iVar2 = *(int *)(param_4 + 0x1c);
  if (0 < iVar2) {
    iVar5 = 0;
    do {
      iVar3 = iVar5 * 0x34;
      iVar5 = iVar5 + 1;
      pVVar4 = (Vector *)(iVar3 + *(int *)(param_4 + 0x10));
      Overlay_WorldToOverlayPlane
                ((Vector *)(param_1 + 0x60),(Vector *)(param_1 + 0x84),pVVar4,pVVar4);
    } while (iVar5 != iVar2);
  }
  return 1;
}

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)