InitMaterialSystemConfig
0x001926f0 · 1160 bytes · __cdecl
_Z24InitMaterialSystemConfigb
Decompiled
undefined (1 param)
/* InitMaterialSystemConfig(bool) */
void InitMaterialSystemConfig(bool param_1)
{
int *piVar1;
int iVar2;
undefined4 *puVar3;
MaterialSystem_Config_t *pMVar4;
byte bVar5;
undefined1 *puVar6;
char *pcVar7;
int local_7c;
int local_78;
undefined4 local_70;
undefined1 local_5b;
undefined4 local_58;
undefined4 local_54;
uint local_48;
undefined4 local_24;
bVar5 = 0;
g_pMaterialSystemConfig = (undefined4 *)(**(code **)(*materials + 0x44))(materials);
if (g_pMaterialSystemConfig == (undefined4 *)0x0) {
Sys_Error("Could not get the material system config record!");
}
if (param_1) {
return;
}
puVar3 = g_pMaterialSystemConfig;
pMVar4 = (MaterialSystem_Config_t *)&local_7c;
for (iVar2 = 0x18; iVar2 != 0; iVar2 = iVar2 + -1) {
*(undefined4 *)pMVar4 = *puVar3;
puVar3 = puVar3 + (uint)bVar5 * -2 + 1;
pMVar4 = pMVar4 + (uint)bVar5 * -8 + 4;
}
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,&DAT_002b74da);
if (iVar2 == 0) {
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-startwindowed");
if (iVar2 != 0) goto LAB_00192757;
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-windowed");
if (iVar2 != 0) goto LAB_00192757;
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-window");
if (iVar2 != 0) goto LAB_00192757;
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-full");
if (iVar2 == 0) {
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-fullscreen");
if (iVar2 != 0) goto LAB_00192a40;
}
else {
LAB_00192a40:
local_48 = local_48 & 0xfffffffe;
}
}
else {
LAB_00192757:
local_48 = local_48 | 1;
}
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-width");
if (iVar2 == 0) {
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,&DAT_002b7512);
if (iVar2 != 0) goto LAB_00192778;
}
else {
LAB_00192778:
piVar1 = (int *)CommandLine_Tier0();
local_7c = (**(code **)(*piVar1 + 0x1c))(piVar1,"-width",local_7c);
piVar1 = (int *)CommandLine_Tier0();
local_7c = (**(code **)(*piVar1 + 0x1c))(piVar1,&DAT_002b7512,local_7c);
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-height");
if (iVar2 == 0) {
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,&DAT_002b7515);
if (iVar2 == 0) {
local_78 = local_7c * 3;
if (local_78 < 0) {
local_78 = local_78 + 3;
}
local_78 = local_78 >> 2;
}
}
}
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-height");
if (iVar2 == 0) {
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,&DAT_002b7515);
if (iVar2 != 0) goto LAB_001927f0;
}
else {
LAB_001927f0:
piVar1 = (int *)CommandLine_Tier0();
local_78 = (**(code **)(*piVar1 + 0x1c))(piVar1,"-height",local_78);
piVar1 = (int *)CommandLine_Tier0();
local_78 = (**(code **)(*piVar1 + 0x1c))(piVar1,&DAT_002b7515,local_78);
}
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-resizing");
if (iVar2 != 0) {
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0xc))(piVar1,"-resizing",0);
if (iVar2 == 0) {
local_48 = local_48 & 0xfffffffd;
}
else {
local_48 = local_48 | 2;
}
}
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-mat_vsync");
if (iVar2 != 0) {
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1,"-mat_vsync",1);
if (iVar2 == 0) {
local_48 = local_48 | 8;
}
else {
local_48 = local_48 & 0xfffffff7;
}
}
piVar1 = (int *)CommandLine_Tier0();
local_58 = (**(code **)(*piVar1 + 0x1c))(piVar1,"-mat_antialias",local_58);
piVar1 = (int *)CommandLine_Tier0();
local_24 = (**(code **)(*piVar1 + 0x1c))(piVar1,"-mat_aaquality",local_24);
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-safe");
if (iVar2 != 0) {
local_48 = local_48 | 1;
local_7c = 0x280;
local_78 = 0x1e0;
local_70 = 0;
local_58 = 0;
local_24 = 0;
local_5b = 0;
}
piVar1 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,&DAT_002b7559);
if (iVar2 == 0) {
puVar6 = (undefined1 *)CommandLine_Tier0();
pcVar7 = "-xbox360";
iVar2 = (**(code **)(*(int *)puVar6 + 0x28))(puVar6,"-xbox360");
if (iVar2 == 0) goto LAB_00192949;
}
pcVar7 = (char *)0x1;
puVar6 = mat_360_aa_override;
local_7c = 0x500;
local_78 = 0x2d0;
local_70 = 0;
local_58 = 0;
local_24 = 0;
local_5b = 0;
local_54 = 4;
ConVar::SetValue(0x3a6ce0);
LAB_00192949:
piVar1 = (int *)CommandLine_Tier0(puVar6,pcVar7);
iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-360aa");
if (iVar2 != 0) {
local_58 = 0;
local_24 = 0;
local_54 = 4;
ConVar::SetValue(0x3a6ce0);
}
OverrideMaterialSystemConfig((MaterialSystem_Config_t *)&local_7c);
(**(code **)(*g_pMaterialSystemHardwareConfig + 0xc0))
(g_pMaterialSystemHardwareConfig,1 < *(int *)(mat_hdr_level._28_4_ + 0x30));
UpdateMaterialSystemConfig();
return;
}
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.