L L4D2node

COM_DXLevelToString

0x001272e0 · 171 bytes · __cdecl

_Z19COM_DXLevelToStringi

Decompiled

undefined (1 param)

/* COM_DXLevelToString(int) */

char * COM_DXLevelToString(int param_1)

{
  bool bVar1;
  char *pcVar2;
  int iVar3;
  
  pcVar2 = (char *)(**(code **)(*g_pMaterialSystemHardwareConfig + 0x4c))
                             (g_pMaterialSystemHardwareConfig);
  if ((pcVar2 == (char *)0x0) || (iVar3 = V_stristr(pcVar2,"nvfx"), iVar3 == 0)) {
    bVar1 = false;
  }
  else {
    bVar1 = true;
  }
  switch(param_1) {
  case 0x3c:
    return "gamemode - 6.0";
  default:
    return "gamemode";
  case 0x46:
    return "gamemode - 7.0";
  case 0x50:
    return "gamemode - 8.0";
  case 0x51:
    return "gamemode - 8.1";
  case 0x52:
    pcVar2 = "gamemode - 8.1 with some 9.0 (half-precision)";
    if (!bVar1) {
      pcVar2 = "gamemode - 8.1 with some 9.0 (full-precision)";
    }
    break;
  case 0x5a:
    pcVar2 = "gamemode - 9.0 (half-precision)";
    if (!bVar1) {
      pcVar2 = "gamemode - 9.0 (full-precision)";
    }
    return pcVar2;
  case 0x5c:
    return "9.0 Shader Model 2.0b";
  case 0x5f:
    return "9.0 Shader Model 3.0";
  case 0x62:
    return "XBox 360";
  case 100:
    return "10.0 Shader Model 4.0";
  }
  return pcVar2;
}

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)