L L4D2node

CModelRender::InitColormeshParams

0x001877d0 · 309 bytes · __thiscall

_ZN12CModelRender19InitColormeshParamsERNS_15ModelInstance_tEP14studiohwdata_tP17colormeshparams_t

Decompiled

undefined (4 params)

/* CModelRender::InitColormeshParams(CModelRender::ModelInstance_t&, studiohwdata_t*,
   colormeshparams_t*) */

void __thiscall
CModelRender::InitColormeshParams
          (CModelRender *this,ModelInstance_t *param_1,studiohwdata_t *param_2,
          colormeshparams_t *param_3)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  int local_38;
  int local_34;
  int local_2c;
  int local_20;
  
  *(undefined4 *)param_3 = 0;
  *(undefined4 *)(param_3 + 4) = 0;
  *(undefined4 *)(param_3 + 8) = 0;
  if (((((byte)param_1[0xfa] & 2) != 0) &&
      (cVar4 = (**(code **)(*g_pMaterialSystemHardwareConfig + 0x94))
                         (g_pMaterialSystemHardwareConfig), cVar4 != '\0')) &&
     (*(int *)(r_proplightingpooling._28_4_ + 0x30) == 1)) {
    *(CModelRender **)(param_3 + 8) = this + 0x5c;
  }
  local_38 = *(int *)param_2;
  local_34 = local_38 * 0x1c;
  if (local_38 < *(int *)(param_2 + 4)) {
    do {
      local_2c = 0;
      iVar2 = *(int *)(param_2 + 8);
      if (0 < *(int *)(param_2 + 0xc)) {
        do {
          piVar1 = (int *)(*(int *)(local_34 + iVar2) + local_2c * 8);
          if (0 < *piVar1) {
            iVar3 = *(int *)param_3;
            local_20 = *(int *)(param_3 + 4);
            iVar5 = 0;
            do {
              *(int *)param_3 = iVar3 + 1 + iVar5;
              iVar6 = iVar5 * 0x28;
              *(undefined4 *)(param_3 + iVar5 * 4 + iVar3 * 4 + 0xc) =
                   *(undefined4 *)(piVar1[1] + 0x14 + iVar6);
              iVar5 = iVar5 + 1;
              local_20 = local_20 + *(int *)(piVar1[1] + 0x14 + iVar6);
              *(int *)(param_3 + 4) = local_20;
            } while (iVar5 < *piVar1);
          }
          local_2c = local_2c + 1;
        } while (local_2c < *(int *)(param_2 + 0xc));
      }
      local_38 = local_38 + 1;
      local_34 = local_34 + 0x1c;
    } while (local_38 < *(int *)(param_2 + 4));
  }
  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)