L L4D2node

SrgbLinearToGamma

0x000ab0e0 · 130 bytes · __cdecl

_Z17SrgbLinearToGammaf

Decompiled

undefined (1 param)

/* SrgbLinearToGamma(float) */

longdouble SrgbLinearToGamma(float param_1)

{
  longdouble lVar1;
  
  if (param_1 <= 0.0) {
    param_1 = 0.0;
  }
  if (1.0 <= param_1) {
    param_1 = 1.0;
  }
  if (0.0031308 < param_1) {
    lVar1 = (longdouble)__pow_finite((double)param_1,0x3fdaaaaaa0000000);
    return (longdouble)(float)((double)lVar1 * 1.0549999475479126 - 0.054999999701976776);
  }
  return (longdouble)(param_1 * 12.92);
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)