CEnvTonemapController::InputBlendTonemapScale
0x00696970 · 526 bytes · __thiscall
_ZN21CEnvTonemapController22InputBlendTonemapScaleER11inputdata_t
Decompiled
undefined (2 params)
/* CEnvTonemapController::InputBlendTonemapScale(inputdata_t&) */
void __thiscall
CEnvTonemapController::InputBlendTonemapScale(CEnvTonemapController *this,inputdata_t *param_1)
{
float fVar1;
int iVar2;
char *pcVar3;
undefined4 uVar4;
undefined1 *puVar5;
int in_GS_OFFSET;
double dVar6;
undefined1 local_124 [21];
char local_10f [255];
int local_10;
local_10 = *(int *)(in_GS_OFFSET + 0x14);
if (*(int *)(param_1 + 0x18) == 2) {
pcVar3 = "";
if (*(char **)(param_1 + 8) != (char *)0x0) {
pcVar3 = *(char **)(param_1 + 8);
}
}
else {
pcVar3 = (char *)variant_t::ToString((variant_t *)(param_1 + 8));
}
V_strncpy(local_10f,pcVar3,0xff);
pcVar3 = strtok(local_10f," ");
if ((pcVar3 == (char *)0x0) || (*pcVar3 == '\0')) {
uVar4 = CBaseEntity::GetDebugName((CBaseEntity *)this);
puVar5 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
puVar5 = *(undefined1 **)(this + 0x7c);
}
Warning("%s (%s) received BlendTonemapScale input without a target tonemap scale. Syntax: <target tonemap scale> <blend time>\n"
,puVar5,uVar4);
}
else {
dVar6 = strtod(pcVar3,(char **)0x0);
*(float *)(this + 0x444) = (float)dVar6;
pcVar3 = strtok((char *)0x0," ");
if ((pcVar3 == (char *)0x0) || (*pcVar3 == '\0')) {
uVar4 = CBaseEntity::GetDebugName((CBaseEntity *)this);
puVar5 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
puVar5 = *(undefined1 **)(this + 0x7c);
}
Warning("%s (%s) received BlendTonemapScale input without a blend time. Syntax: <target tonemap scale> <blend time>\n"
,puVar5,uVar4);
}
else {
fVar1 = *(float *)(gpGlobals + 0xc);
dVar6 = strtod(pcVar3,(char **)0x0);
iVar2 = gpGlobals;
uVar4 = mat_hdr_tonemapscale._28_4_;
*(float *)(this + 0x448) = (float)(dVar6 + (double)fVar1);
*(undefined4 *)(this + 0x44c) = *(undefined4 *)(iVar2 + 0xc);
*(undefined4 *)(this + 0x440) = *(undefined4 *)(uVar4 + 0x2c);
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(iVar2 + 0xc) + 0.1,(char *)0x0);
CBaseEntity::ThinkSet((_func_void *)local_124,(float)this,(char *)UpdateTonemapScaleBlend);
}
}
if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.