L L4D2node

CFrameTimer::MarkFrame

0x001765b0 · 537 bytes · __thiscall

_ZN11CFrameTimer9MarkFrameEv

Decompiled

undefined (1 param)

/* CFrameTimer::MarkFrame() */

void __thiscall CFrameTimer::MarkFrame(CFrameTimer *this)

{
  double dVar1;
  double dVar2;
  double dVar3;
  double dVar4;
  double dVar5;
  double dVar6;
  double dVar7;
  float fVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  int in_GS_OFFSET;
  char local_120 [256];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar9 = 0;
  dVar1 = *(double *)(this + 0xb8);
  dVar2 = *(double *)(this + 0xa8);
  dVar3 = *(double *)(this + 0xc0);
  dVar4 = *(double *)(this + 0xb0);
  dVar5 = *(double *)(this + 200);
  dVar6 = *(double *)(this + 0xd0);
  dVar7 = *(double *)(this + 0xd8);
  *(float *)(this + 0xe0) = (float)(dVar1 * 1000.0);
  do {
    *(undefined8 *)(this + iVar9 * 8 + 0xa8) = 0;
    iVar9 = iVar9 + 1;
  } while (iVar9 != 7);
  if (host_frametime < 0.0001) {
    fVar8 = 999.0;
  }
  else {
    fVar8 = 1.0 / host_frametime;
  }
  if (*(int *)(host_speeds._28_4_ + 0x30) != 0) {
    iVar9 = host_tickcount - MarkFrame()::last_host_tickcount;
    MarkFrame()::last_host_tickcount = host_tickcount;
    if (DAT_003b816c < 1) {
      iVar11 = 0;
    }
    else {
      iVar10 = 0;
      iVar11 = 0;
      do {
        iVar11 = iVar11 + (uint)((*(uint *)(DAT_003b8174 + iVar10) & 2) == 0);
        iVar10 = iVar10 + 0x10;
      } while (iVar10 != DAT_003b816c * 0x10);
    }
    V_snprintf(local_120,0x100,
               "%3i fps -- inp(%3.1f) sv(%3.1f) cl(%3.1f) render(%3.1f) snd(%3.1f) cl_dll(%3.1f) exec(%3.1f) ents(%d) ticks(%d)"
               ,(int)fVar8,(double)(float)(dVar2 * 1000.0),(double)(float)(dVar1 * 1000.0),
               (double)(float)(dVar4 * 1000.0),(double)(float)(dVar3 * 1000.0),
               (double)(float)(dVar5 * 1000.0),(double)(float)(dVar6 * 1000.0),
               (double)(float)(dVar7 * 1000.0),iVar11,iVar9);
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)