Shader_Connect
0x001680c0 · 228 bytes · __cdecl
_Z14Shader_Connectb
Decompiled
undefined (1 param)
/* Shader_Connect(bool) */
bool Shader_Connect(bool param_1)
{
int *piVar1;
undefined4 uVar2;
int iVar3;
bool bVar4;
bVar4 = false;
if (materials != (int *)0x0) {
piVar1 = (int *)CommandLine_Tier0();
uVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1,"-adapter",0);
piVar1 = (int *)CommandLine_Tier0();
iVar3 = (**(code **)(*piVar1 + 0x28))(piVar1,&DAT_002b06d5);
(**(code **)(*materials + 0x1c))(materials,uVar2,(-(uint)(iVar3 == 0) & 0xfffffffc) + 6);
if (param_1) {
(**(code **)(*materials + 0xdc))(materials,&s_MaterialProxyFactory);
}
if (g_pMaterialSystemHardwareConfig == 0) {
Sys_Error("Could not get the material system hardware config interface! (2)");
}
if (g_pMaterialSystemDebugTextureInfo == 0) {
Sys_Error("Could not get the debug texture info interface!");
}
if (g_pMaterialSystemHardwareConfig == 0) {
return false;
}
bVar4 = g_pMaterialSystemDebugTextureInfo != 0;
}
return bVar4;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.