Skip to content

Commit

Permalink
Clamp gamma to 0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-drexler committed Sep 9, 2024
1 parent bb77454 commit 55c5c8e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Quake/gl_vidsdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,24 @@ void VID_SetMouseCursor (mousecursor_t cursor)
//
//==========================================================================

#define MIN_GAMMA 0.1f

static int fsaa;

/*
================
VID_Gamma_f -- called when gamma changes
================
*/
static void VID_Gamma_f (cvar_t *var)
{
if (var->value < MIN_GAMMA)
{
Con_SafePrintf ("%s %g is too low, clamping to %g\n", var->name, var->value, MIN_GAMMA);
Cvar_SetValueQuick (var, MIN_GAMMA);
}
}

/*
================
VID_Gamma_Init -- call on init
Expand All @@ -231,6 +247,7 @@ VID_Gamma_Init -- call on init
static void VID_Gamma_Init (void)
{
Cvar_RegisterVariable (&vid_gamma);
Cvar_SetCallback (&vid_gamma, VID_Gamma_f);
Cvar_RegisterVariable (&vid_contrast);
}

Expand Down

0 comments on commit 55c5c8e

Please sign in to comment.