L L4D2node

CModelLoader::Sprite_LoadModel

0x0019a740 · 850 bytes · __thiscall

_ZN12CModelLoader16Sprite_LoadModelEP7model_t

Decompiled

undefined (2 params)

/* CModelLoader::Sprite_LoadModel(model_t*) */

void __thiscall CModelLoader::Sprite_LoadModel(CModelLoader *this,model_t *param_1)

{
  short sVar1;
  short sVar2;
  int *piVar3;
  undefined4 uVar4;
  int in_GS_OFFSET;
  bool *in_stack_fffffeb8;
  char local_126;
  bool local_125;
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  *(uint *)(param_1 + 0x108) = *(uint *)(param_1 + 0x108) | 1;
  *(undefined4 *)(param_1 + 0x110) = 2;
  *(undefined4 *)(param_1 + 0x140) = 0;
  *(undefined4 *)(param_1 + 0x124) = 0;
  *(undefined4 *)(param_1 + 0x128) = 0;
  *(undefined4 *)(param_1 + 300) = 0;
  *(undefined4 *)(param_1 + 0x118) = 0;
  *(undefined4 *)(param_1 + 0x11c) = 0;
  *(undefined4 *)(param_1 + 0x120) = 0;
  BuildSpriteLoadName((char *)(param_1 + 4),local_124,(int)&local_126,&local_125,in_stack_fffffeb8);
  *(undefined4 *)(param_1 + 0x134) = 1;
  *(undefined4 *)(param_1 + 0x13c) = 1;
  *(undefined4 *)(param_1 + 0x138) = 1;
  if (local_126 == '\0') {
    if (local_125 == false) {
      piVar3 = (int *)GL_LoadMaterial(local_124,"Other textures",false);
      if (piVar3 == (int *)0x0) {
        sVar1 = -1;
        sVar2 = -1;
      }
      else {
        sVar2 = -1;
        uVar4 = (**(code **)(*piVar3 + 0x10))(piVar3);
        *(undefined4 *)(param_1 + 0x138) = uVar4;
        uVar4 = (**(code **)(*piVar3 + 0x14))(piVar3);
        *(undefined4 *)(param_1 + 0x13c) = uVar4;
        uVar4 = (**(code **)(*piVar3 + 0x18))(piVar3);
        sVar1 = -1;
        *(undefined4 *)(param_1 + 0x134) = uVar4;
      }
    }
    else {
      sVar1 = (**(code **)(*g_pBIK + 0x14))(g_pBIK,local_124,local_124,&DAT_002a076d,0);
      if (sVar1 == -1) {
        sVar2 = -1;
        piVar3 = (int *)0x0;
      }
      else {
        (**(code **)(*g_pBIK + 0x2c))(g_pBIK,sVar1,param_1 + 0x138,param_1 + 0x13c);
        uVar4 = (**(code **)(*g_pBIK + 0x34))(g_pBIK,sVar1);
        sVar2 = -1;
        *(undefined4 *)(param_1 + 0x134) = uVar4;
        piVar3 = (int *)(**(code **)(*g_pBIK + 0x24))(g_pBIK,sVar1);
      }
    }
  }
  else {
    sVar2 = (**(code **)(*g_pAVI + 0x28))(g_pAVI,local_124,local_124,&DAT_002a076d);
    (**(code **)(*g_pAVI + 0x3c))(g_pAVI,sVar2,param_1 + 0x138,param_1 + 0x13c);
    uVar4 = (**(code **)(*g_pAVI + 0x44))(g_pAVI,sVar2);
    *(undefined4 *)(param_1 + 0x134) = uVar4;
    if (sVar2 == -1) {
      sVar1 = -1;
      piVar3 = (int *)0x0;
    }
    else {
      piVar3 = (int *)(**(code **)(*g_pAVI + 0x34))(g_pAVI,sVar2);
      sVar1 = -1;
    }
  }
  if (g_materialEmpty == piVar3) {
    DevMsg("Missing sprite material %s\n",local_124);
  }
  if (sVar2 != -1) {
    (**(code **)(*g_pAVI + 0x2c))(g_pAVI,sVar2);
  }
  if (sVar1 != -1) {
    (**(code **)(*g_pBIK + 0x18))(g_pBIK,sVar1);
  }
  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)