R_DecalGetMaterialAndSize
0x001dad20 · 262 bytes · __cdecl
_Z25R_DecalGetMaterialAndSizeiRP9IMaterialRfS2_
Decompiled
undefined (4 params)
/* R_DecalGetMaterialAndSize(int, IMaterial*&, float&, float&) */
void R_DecalGetMaterialAndSize(int param_1,IMaterial **param_2,float *param_3,float *param_4)
{
IMaterial *pIVar1;
int *piVar2;
int iVar3;
longdouble lVar4;
float fVar5;
float local_10;
pIVar1 = (IMaterial *)Draw_DecalMaterial(param_1);
*param_2 = pIVar1;
if (pIVar1 != (IMaterial *)0x0) {
piVar2 = (int *)(**(code **)(*(int *)pIVar1 + 0xbc))(pIVar1,"$decalScale",&s_DecalScaleVarCache)
;
local_10 = 1.0;
if (piVar2 != (int *)0x0) {
lVar4 = (longdouble)(**(code **)(*piVar2 + 0x6c))(piVar2);
local_10 = (float)lVar4;
}
piVar2 = (int *)(**(code **)(*(int *)*param_2 + 0xbc))
(*param_2,"$decalScaleVariation",&s_DecalScaleVariationVarCache);
if (piVar2 != (int *)0x0) {
lVar4 = (longdouble)(**(code **)(*piVar2 + 0x6c))(piVar2);
fVar5 = (float)lVar4;
if (fVar5 <= 0.0) {
fVar5 = 0.0;
}
if (0.99 <= fVar5) {
fVar5 = 0.99;
}
lVar4 = (longdouble)RandomFloat(-fVar5,fVar5);
local_10 = ((float)lVar4 + 1.0) * local_10;
}
iVar3 = (**(code **)(*(int *)*param_2 + 0x10))(*param_2);
*param_3 = (float)iVar3 * local_10;
iVar3 = (**(code **)(*(int *)*param_2 + 0x14))(*param_2);
*param_4 = (float)iVar3 * local_10;
}
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.