L L4D2node

RenderLine

0x00285330 · 1874 bytes · __cdecl

_Z10RenderLineRK6VectorS1_5Colorb

Decompiled

undefined (4 params)

/* RenderLine(Vector const&, Vector const&, Color, bool) */

void RenderLine(undefined4 *param_1,undefined4 *param_2,uint param_3,char param_4)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  code *pcVar6;
  char cVar7;
  int *piVar8;
  undefined4 *puVar9;
  undefined4 *puVar10;
  int *piVar11;
  uint uVar12;
  undefined4 uVar13;
  int iVar14;
  int *piVar15;
  int *piVar16;
  byte bVar17;
  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;
  uint local_60;
  undefined4 local_5c;
  undefined4 *local_58;
  int local_54;
  int local_50;
  int local_4c [8];
  undefined4 local_2c;
  int local_28;
  ushort *local_24;
  
  bVar17 = 0;
  InitializeStandardMaterials();
  piVar8 = (int *)(**(code **)(*materials + 0x180))(materials);
  if (piVar8 != (int *)0x0) {
                    /* try { // try from 00285366 to 00285368 has its CatchHandler @ 00285a97 */
    (**(code **)(*piVar8 + 8))(piVar8);
  }
                    /* try { // try from 00285374 to 0028545f has its CatchHandler @ 00285ae1 */
  puVar9 = (undefined4 *)(**(code **)(*piVar8 + 0x238))(piVar8);
  if (puVar9 == (undefined4 *)0x0) {
    uVar13 = s_pWireframe;
    if (param_4 == '\0') {
      uVar13 = s_pWireframeIgnoreZ;
    }
                    /* try { // try from 002854bb to 00285511 has its CatchHandler @ 00285ae1 */
    (**(code **)(*piVar8 + 0x24))(piVar8,uVar13,0);
    piVar11 = (int *)(**(code **)(*piVar8 + 0xe8))(piVar8,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 002855cb to 002858b6 has its CatchHandler @ 00285ab3 */
    local_150 = piVar11;
    (**(code **)(*piVar11 + 0x30))(piVar11,1);
    (**(code **)(*local_150 + 0x4c))(local_150,2,2,local_204);
    local_6c = piVar11;
    local_68 = 0;
    piVar15 = local_204;
    piVar16 = local_110;
    for (iVar14 = 0x29; iVar14 != 0; iVar14 = iVar14 + -1) {
      *piVar16 = *piVar15;
      piVar15 = piVar15 + (uint)bVar17 * -2 + 1;
      piVar16 = piVar16 + (uint)bVar17 * -2 + 1;
    }
    local_134 = piVar11 + 1;
    local_12c = 0;
    local_144 = local_160;
    local_130 = 2;
    local_114 = 0;
    local_128 = local_168;
    local_138 = local_154;
    local_124 = 0;
    local_64 = 2;
    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;
    puVar9 = local_a4;
    do {
      puVar10 = puVar9 + 1;
      puVar9[0x16] = *puVar9;
      puVar9 = puVar10;
    } while (puVar10 != local_84);
    *local_bc = *param_1;
    local_bc[1] = param_1[1];
    local_bc[2] = param_1[2];
    uVar12 = (param_3 >> 8 & 0xff) << 8 | (param_3 & 0xff) << 0x10 | param_3 >> 0x10 & 0xff |
             param_3 & 0xff000000;
    *local_ac = uVar12;
    local_54 = local_b0 + local_104 * 2;
    local_bc = (undefined4 *)((int)local_bc + local_110[0]);
    local_4c[0] = local_4c[0] + local_f8 * 2;
    local_4c[1] = local_4c[1] + local_f4 * 2;
    local_4c[2] = local_4c[2] + local_f0 * 2;
    local_4c[3] = local_4c[3] + local_ec * 2;
    local_4c[4] = local_4c[4] + local_e8 * 2;
    local_4c[5] = local_4c[5] + local_e4 * 2;
    local_4c[6] = local_4c[6] + local_e0 * 2;
    local_4c[7] = local_4c[7] + local_dc * 2;
    *local_bc = *param_2;
    local_bc[1] = param_2[1];
    local_bc[2] = param_2[2];
    *(uint *)((int)local_ac + local_100) = uVar12;
    local_5c = 2;
    local_60 = 2;
    local_58 = (undefined4 *)((int)local_bc + local_110[0]);
    local_50 = (int)local_ac + local_100 + local_100;
    if (local_148 != '\0') {
      switch(local_14c) {
      case 4:
        uVar12 = 2;
        break;
      case 5:
        uVar12 = 4;
        break;
      case 6:
        uVar12 = 0;
        break;
      case 7:
        uVar12 = 3;
        break;
      default:
        uVar12 = local_60;
        break;
      case 9:
        uVar12 = 0;
      }
      if (local_154 != 0) {
        if (2 < uVar12) {
          uVar12 = 2;
        }
        if (uVar12 != 0) {
          switch(local_14c) {
          case 0:
          case 9:
            break;
          default:
            GenerateSequentialIndexBuffer(local_160,uVar12,(int)local_168);
            break;
          case 4:
            GenerateLineStripIndexBuffer(local_160,uVar12,(int)local_168);
            break;
          case 5:
                    /* try { // try from 002859fa to 00285a91 has its CatchHandler @ 00285ab3 */
            GenerateLineLoopIndexBuffer(local_160,uVar12,(int)local_168);
            break;
          case 6:
            GeneratePolygonIndexBuffer(local_168,(int)local_160,uVar12);
            break;
          case 7:
            GenerateQuadIndexBuffer(local_160,uVar12,(int)local_168);
          }
          local_124 = local_124 + uVar12 * local_138;
          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 **)(*piVar11 + 0x34))(piVar11,0xffffffff,0);
    if ((local_6c != (int *)0x0) &&
       (cVar7 = (**(code **)(*local_6c + 0x10))(local_6c), cVar7 != '\0')) {
      (**(code **)(*local_6c + 0x18))(local_6c);
    }
    if ((local_134 != (int *)0x0) &&
       (cVar7 = (**(code **)(*local_134 + 0x10))(local_134), cVar7 != '\0')) {
      (**(code **)(*local_134 + 0x18))(local_134);
    }
    if ((piVar8 != (int *)0x0) && ((**(code **)(*piVar8 + 0xc))(piVar8), piVar8 != (int *)0x0)) {
      (**(code **)(*piVar8 + 4))(piVar8);
      return;
    }
  }
  else {
    uVar13 = *param_1;
    uVar1 = param_1[1];
    uVar2 = param_1[2];
    uVar3 = *param_2;
    uVar4 = param_2[1];
    uVar5 = param_2[2];
    pcVar6 = *(code **)*puVar9;
    puVar10 = operator_new(0x34);
    puVar10[3] = 1;
    *puVar10 = &PTR_AddRef_002d03c8;
    puVar10[2] = &PTR__CFunctor4_002d03e4;
    puVar10[4] = RenderLine;
    puVar10[0xb] = param_3;
    puVar10[5] = uVar13;
    puVar10[6] = uVar1;
    puVar10[7] = uVar2;
    puVar10[8] = uVar3;
    puVar10[9] = uVar4;
    puVar10[10] = uVar5;
    *(char *)(puVar10 + 0xc) = param_4;
    (*pcVar6)(puVar9,puVar10);
    if ((piVar8 != (int *)0x0) && ((**(code **)(*piVar8 + 0xc))(piVar8), piVar8 != (int *)0x0)) {
      (**(code **)(*piVar8 + 4))(piVar8);
    }
  }
  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)