InitializeStandardMaterials
0x002825d0 · 774 bytes · unknown
_Z27InitializeStandardMaterialsv
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* InitializeStandardMaterials() */
uint InitializeStandardMaterials(void)
{
uint uVar1;
uint uVar2;
KeyValues *pKVar3;
int iVar4;
bool bVar5;
uint in_stack_ffffffe8;
char *pcVar6;
if ((InitializeStandardMaterials()::autoMutex__ == '\0') &&
(iVar4 = __cxa_guard_acquire(&InitializeStandardMaterials()::autoMutex__), iVar4 != 0)) {
InitializeStandardMaterials()::autoMutex__ = 0;
DAT_00409650 = 0;
__cxa_guard_release(&InitializeStandardMaterials()::autoMutex__);
}
uVar2 = ThreadGetCurrentId();
if (uVar2 != InitializeStandardMaterials()::autoMutex__) {
LOCK();
bVar5 = InitializeStandardMaterials()::autoMutex__ != 0;
uVar1 = uVar2;
if (bVar5) {
uVar1 = InitializeStandardMaterials()::autoMutex__;
}
InitializeStandardMaterials()::autoMutex__ = uVar1;
UNLOCK();
if (bVar5) {
CThreadFastMutex::Lock(0x40964c,uVar2);
in_stack_ffffffe8 = uVar2;
goto joined_r0x00282661;
}
}
DAT_00409650 = DAT_00409650 + 1;
joined_r0x00282661:
if (s_bMaterialsInitialized == '\0') {
s_bMaterialsInitialized = '\x01';
/* try { // try from 00282671 to 00282675 has its CatchHandler @ 00282914 */
pKVar3 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffe8);
/* try { // try from 00282693 to 00282697 has its CatchHandler @ 00282916 */
KeyValues::KeyValues(pKVar3,"wireframe",(IKeyValuesSystem *)0x0,false);
/* try { // try from 002826ab to 002826e4 has its CatchHandler @ 00282914 */
KeyValues::SetInt(pKVar3,"$vertexcolor",1);
pcVar6 = "__utilWireframe";
s_pWireframe = (int *)(**(code **)(*g_pMaterialSystem + 0x118))
(g_pMaterialSystem,"__utilWireframe",pKVar3);
(**(code **)(*s_pWireframe + 0x30))(s_pWireframe);
pKVar3 = KeyValues::operator_new((KeyValues *)0x2c,(uint)pcVar6);
/* try { // try from 00282702 to 00282706 has its CatchHandler @ 00282924 */
KeyValues::KeyValues(pKVar3,"wireframe",(IKeyValuesSystem *)0x0,false);
/* try { // try from 0028271a to 00282783 has its CatchHandler @ 00282914 */
KeyValues::SetInt(pKVar3,"$vertexcolor",1);
KeyValues::SetInt(pKVar3,"$vertexalpha",1);
KeyValues::SetInt(pKVar3,"$ignorez",1);
pcVar6 = "__utilWireframeIgnoreZ";
s_pWireframeIgnoreZ =
(int *)(**(code **)(*g_pMaterialSystem + 0x118))
(g_pMaterialSystem,"__utilWireframeIgnoreZ",pKVar3);
(**(code **)(*s_pWireframeIgnoreZ + 0x30))(s_pWireframeIgnoreZ);
pKVar3 = KeyValues::operator_new((KeyValues *)0x2c,(uint)pcVar6);
/* try { // try from 002827a1 to 002827a5 has its CatchHandler @ 00282932 */
KeyValues::KeyValues(pKVar3,"unlitgeneric",(IKeyValuesSystem *)0x0,false);
/* try { // try from 002827b9 to 0028280a has its CatchHandler @ 00282914 */
KeyValues::SetInt(pKVar3,"$vertexcolor",1);
KeyValues::SetInt(pKVar3,"$vertexalpha",1);
pcVar6 = "__utilVertexColor";
s_pVertexColor =
(int *)(**(code **)(*g_pMaterialSystem + 0x118))
(g_pMaterialSystem,"__utilVertexColor",pKVar3);
(**(code **)(*s_pVertexColor + 0x30))(s_pVertexColor);
pKVar3 = KeyValues::operator_new((KeyValues *)0x2c,(uint)pcVar6);
/* try { // try from 00282828 to 0028282c has its CatchHandler @ 002828e1 */
KeyValues::KeyValues(pKVar3,"unlitgeneric",(IKeyValuesSystem *)0x0,false);
/* try { // try from 00282840 to 0028289d has its CatchHandler @ 00282914 */
KeyValues::SetInt(pKVar3,"$vertexcolor",1);
KeyValues::SetInt(pKVar3,"$vertexalpha",1);
KeyValues::SetInt(pKVar3,"$ignorez",1);
s_pVertexColorIgnoreZ =
(int *)(**(code **)(*g_pMaterialSystem + 0x118))
(g_pMaterialSystem,"__utilVertexColorIgnoreZ",pKVar3);
(**(code **)(*s_pVertexColorIgnoreZ + 0x30))(s_pVertexColorIgnoreZ);
}
DAT_00409650 = DAT_00409650 - 1;
uVar2 = DAT_00409650;
if (DAT_00409650 == 0) {
LOCK();
UNLOCK();
uVar2 = InitializeStandardMaterials()::autoMutex__;
InitializeStandardMaterials()::autoMutex__ = 0;
}
return uVar2;
}
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.