L L4D2node

RenderWireframeBox

0x00283f90 · 2165 bytes · __cdecl

_Z18RenderWireframeBoxRK6VectorRK6QAngleS1_S1_5Colorb

Decompiled

undefined (6 params)

/* RenderWireframeBox(Vector const&, QAngle const&, Vector const&, Vector const&, Color, bool) */

void RenderWireframeBox(Vector *param_1,QAngle *param_2,Vector *param_3,Vector *param_4,uint param_5
                       ,char param_6)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  undefined4 uVar10;
  undefined4 uVar11;
  code *pcVar12;
  int iVar13;
  char cVar14;
  int *piVar15;
  undefined4 *puVar16;
  undefined4 *puVar17;
  int *piVar18;
  undefined4 uVar19;
  int iVar20;
  int *piVar21;
  uint uVar22;
  int *piVar23;
  int iVar24;
  byte bVar25;
  Vector local_264 [4];
  undefined4 auStack_260 [23];
  int local_204 [39];
  ushort *local_168;
  int local_164;
  ushort *local_160;
  int local_154;
  int *local_150;
  undefined4 local_14c;
  char local_148;
  ushort *local_144;
  int local_138;
  int *local_134;
  undefined4 local_130;
  int local_12c;
  ushort *local_128;
  int local_124;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined1 local_114;
  int local_110 [3];
  int local_104;
  int local_100;
  int local_f8;
  int local_f4;
  int local_f0;
  int local_ec;
  int local_e8;
  int local_e4;
  int local_e0;
  int local_dc;
  undefined4 local_c4;
  uint local_c0;
  undefined4 *local_bc;
  int local_b0;
  uint *local_ac;
  undefined4 local_a4 [8];
  undefined4 local_84 [6];
  int *local_6c;
  undefined1 local_68;
  undefined4 local_64;
  int local_60;
  int local_5c;
  undefined4 *local_58;
  int local_54;
  uint *local_50;
  int local_4c [8];
  undefined4 local_2c;
  int local_28;
  ushort *local_24;
  
  bVar25 = 0;
  InitializeStandardMaterials();
  piVar15 = (int *)(**(code **)(*materials + 0x180))(materials);
  if (piVar15 != (int *)0x0) {
                    /* try { // try from 00283fc6 to 00283fc8 has its CatchHandler @ 0028485d */
    (**(code **)(*piVar15 + 8))(piVar15);
  }
                    /* try { // try from 00283fd4 to 0028415f has its CatchHandler @ 00284859 */
  puVar16 = (undefined4 *)(**(code **)(*piVar15 + 0x238))(piVar15);
  if (puVar16 == (undefined4 *)0x0) {
    uVar19 = s_pWireframe;
    if (param_6 == '\0') {
      uVar19 = s_pWireframeIgnoreZ;
    }
                    /* try { // try from 002841bb to 0028422c has its CatchHandler @ 00284859 */
    (**(code **)(*piVar15 + 0x24))(piVar15,uVar19,0);
    GenerateBoxVertices(param_1,param_2,param_3,param_4,local_264);
    piVar18 = (int *)(**(code **)(*piVar15 + 0xe8))(piVar15,1,0,0,0);
    local_134 = (int *)0x0;
    local_130 = 0;
    local_12c = 0;
    local_124 = 0;
    local_120 = 0;
    local_11c = 0xffffffff;
    local_118 = 0;
    local_6c = (int *)0x0;
    local_28 = -1;
    local_24 = (ushort *)0x0;
    local_60 = 0;
    local_5c = 0;
    local_64 = 0;
    local_2c = 0;
    local_c4 = 0xffffffff;
    local_148 = '\x01';
    local_14c = 1;
                    /* try { // try from 002842e6 to 00284624 has its CatchHandler @ 00284825 */
    local_150 = piVar18;
    (**(code **)(*piVar18 + 0x30))(piVar18,1);
    (**(code **)(*local_150 + 0x4c))(local_150,0x30,0x30,local_204);
    local_6c = piVar18;
    local_68 = 0;
    piVar21 = local_204;
    piVar23 = local_110;
    for (iVar20 = 0x29; iVar20 != 0; iVar20 = iVar20 + -1) {
      *piVar23 = *piVar21;
      piVar21 = piVar21 + (uint)bVar25 * -2 + 1;
      piVar23 = piVar23 + (uint)bVar25 * -2 + 1;
    }
    local_134 = piVar18 + 1;
    local_12c = 0;
    local_144 = local_160;
    local_130 = 0x30;
    local_114 = 0;
    local_128 = local_168;
    local_138 = local_154;
    local_124 = 0;
    local_64 = 0x30;
    local_60 = 0;
    local_c0 = ~-(uint)(local_c0 == 0) & 2;
    if (local_28 == -1) {
      local_2c = 0;
      local_24 = local_168;
      local_28 = local_164;
    }
    local_5c = 0;
    local_54 = local_b0;
    local_58 = local_bc;
    puVar16 = local_a4;
    do {
      puVar17 = puVar16 + 1;
      puVar16[0x16] = *puVar16;
      puVar16 = puVar17;
    } while (puVar17 != local_84);
    puVar16 = &s_pBoxFaceIndices;
    local_50 = local_ac;
    uVar22 = (param_5 & 0xff) << 0x10 | param_5 & 0xff000000 | param_5 >> 0x10 & 0xff |
             (param_5 >> 8 & 0xff) << 8;
    do {
      iVar20 = 1;
      local_58 = local_bc;
      do {
        iVar13 = local_5c;
        iVar24 = puVar16[iVar20 + -1];
        *local_58 = *(undefined4 *)(local_264 + iVar24 * 0xc);
        local_58[1] = auStack_260[iVar24 * 3];
        local_58[2] = auStack_260[iVar24 * 3 + 1];
        *local_50 = uVar22;
        local_5c = local_5c + 1;
        if (local_60 < local_5c) {
          local_60 = local_5c;
        }
        local_54 = local_54 + local_104;
        local_58 = (undefined4 *)((int)local_58 + local_110[0]);
        local_50 = (uint *)((int)local_50 + local_100);
        local_4c[0] = local_4c[0] + local_f8;
        local_4c[1] = local_4c[1] + local_f4;
        local_4c[2] = local_4c[2] + local_f0;
        local_4c[3] = local_4c[3] + local_ec;
        local_4c[4] = local_4c[4] + local_e8;
        local_4c[5] = local_4c[5] + local_e4;
        local_4c[6] = local_4c[6] + local_e0;
        local_4c[7] = local_4c[7] + local_dc;
        if (iVar20 == 4) {
          iVar24 = 0;
        }
        else {
          iVar24 = iVar20 * 4;
        }
        iVar24 = *(int *)((int)puVar16 + iVar24);
        *local_58 = *(undefined4 *)(local_264 + iVar24 * 0xc);
        local_58[1] = auStack_260[iVar24 * 3];
        local_58[2] = auStack_260[iVar24 * 3 + 1];
        *local_50 = uVar22;
        local_5c = iVar13 + 2;
        if (local_60 < local_5c) {
          local_60 = local_5c;
        }
        iVar20 = iVar20 + 1;
        local_54 = local_54 + local_104;
        local_bc = (undefined4 *)((int)local_58 + local_110[0]);
        local_50 = (uint *)((int)local_50 + local_100);
        local_58 = local_bc;
        local_4c[0] = local_4c[0] + local_f8;
        local_4c[1] = local_4c[1] + local_f4;
        local_4c[2] = local_4c[2] + local_f0;
        local_4c[3] = local_4c[3] + local_ec;
        local_4c[4] = local_4c[4] + local_e8;
        local_4c[5] = local_4c[5] + local_e4;
        local_4c[6] = local_4c[6] + local_e0;
        local_4c[7] = local_4c[7] + local_dc;
      } while (iVar20 != 5);
      puVar16 = puVar16 + 4;
    } while (puVar16 != (undefined4 *)g_aFadeData);
    if (local_148 != '\0') {
      switch(local_14c) {
      case 4:
        iVar20 = local_60 * 2 + -2;
        break;
      case 5:
        iVar20 = local_60 * 2;
        break;
      case 6:
        iVar20 = local_60 * 3 + -6;
        break;
      case 7:
        iVar24 = local_60 * 6;
        iVar20 = iVar24 + 3;
        if (-1 < iVar24) {
          iVar20 = iVar24;
        }
        iVar20 = iVar20 >> 2;
        break;
      default:
        iVar20 = local_60;
        break;
      case 9:
        iVar20 = 0;
      }
      if (local_154 != 0) {
        if (0x30 < iVar20) {
          iVar20 = 0x30;
        }
        if (iVar20 != 0) {
          switch(local_14c) {
          case 0:
          case 9:
            break;
          default:
            GenerateSequentialIndexBuffer(local_160,iVar20,(int)local_168);
            break;
          case 4:
            GenerateLineStripIndexBuffer(local_160,iVar20,(int)local_168);
            break;
          case 5:
            GenerateLineLoopIndexBuffer(local_160,iVar20,(int)local_168);
            break;
          case 6:
                    /* try { // try from 0028476a to 00284801 has its CatchHandler @ 00284825 */
            GeneratePolygonIndexBuffer(local_168,(int)local_160,iVar20);
            break;
          case 7:
            GenerateQuadIndexBuffer(local_160,iVar20,(int)local_168);
          }
          local_124 = local_124 + local_138 * iVar20;
          if (local_12c < local_124) {
            local_12c = local_124;
          }
        }
      }
    }
    (**(code **)(*local_150 + 0x58))(local_150,local_60,local_12c,local_204);
    local_134 = (int *)0x0;
    local_130 = 0;
    local_64 = 0;
    local_6c = (int *)0x0;
    local_c4 = 0xffffffff;
    local_150 = (int *)0x0;
    (**(code **)(*piVar18 + 0x34))(piVar18,0xffffffff,0);
    if ((local_6c != (int *)0x0) &&
       (cVar14 = (**(code **)(*local_6c + 0x10))(local_6c), cVar14 != '\0')) {
      (**(code **)(*local_6c + 0x18))(local_6c);
    }
    if ((local_134 != (int *)0x0) &&
       (cVar14 = (**(code **)(*local_134 + 0x10))(local_134), cVar14 != '\0')) {
      (**(code **)(*local_134 + 0x18))(local_134);
    }
    if ((piVar15 != (int *)0x0) && ((**(code **)(*piVar15 + 0xc))(piVar15), piVar15 != (int *)0x0))
    {
      (**(code **)(*piVar15 + 4))(piVar15);
      return;
    }
  }
  else {
    uVar19 = *(undefined4 *)param_4;
    uVar1 = *(undefined4 *)(param_4 + 4);
    uVar2 = *(undefined4 *)(param_4 + 8);
    uVar3 = *(undefined4 *)param_3;
    uVar4 = *(undefined4 *)(param_3 + 4);
    uVar5 = *(undefined4 *)(param_3 + 8);
    uVar6 = *(undefined4 *)param_2;
    uVar7 = *(undefined4 *)(param_2 + 4);
    uVar8 = *(undefined4 *)(param_2 + 8);
    uVar9 = *(undefined4 *)param_1;
    uVar10 = *(undefined4 *)(param_1 + 4);
    uVar11 = *(undefined4 *)(param_1 + 8);
    pcVar12 = *(code **)*puVar16;
    puVar17 = operator_new(0x4c);
    puVar17[3] = 1;
    *puVar17 = &PTR_AddRef_002d02c8;
    puVar17[2] = &PTR__CFunctor6_002d02e4;
    puVar17[5] = uVar9;
    puVar17[6] = uVar10;
    puVar17[7] = uVar11;
    puVar17[8] = uVar6;
    puVar17[0x11] = param_5;
    puVar17[4] = RenderWireframeBox;
    puVar17[9] = uVar7;
    puVar17[10] = uVar8;
    puVar17[0xb] = uVar3;
    puVar17[0xc] = uVar4;
    puVar17[0xd] = uVar5;
    puVar17[0xe] = uVar19;
    puVar17[0xf] = uVar1;
    puVar17[0x10] = uVar2;
    *(char *)(puVar17 + 0x12) = param_6;
    (*pcVar12)(puVar16,puVar17);
    if ((piVar15 != (int *)0x0) && ((**(code **)(*piVar15 + 0xc))(piVar15), piVar15 != (int *)0x0))
    {
      (**(code **)(*piVar15 + 4))(piVar15);
    }
  }
  return;
}

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)