mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-02 22:11:22 +00:00
simplify VID_Gamma_f: the oldgamma stuff is already handled by the cvar
system itself. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@751 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
53c55f6bd3
commit
769d2ac75b
1 changed files with 1 additions and 7 deletions
|
@ -196,18 +196,12 @@ VID_Gamma_f -- callback when the cvar changes
|
|||
*/
|
||||
static void VID_Gamma_f (cvar_t *var)
|
||||
{
|
||||
static float oldgamma;
|
||||
int i;
|
||||
|
||||
if (vid_gamma.value == oldgamma)
|
||||
return;
|
||||
|
||||
oldgamma = vid_gamma.value;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
vid_gamma_red[i] =
|
||||
CLAMP(0, (int) (255 * pow ((i+0.5)/255.5, vid_gamma.value) + 0.5), 255) << 8;
|
||||
CLAMP(0, (int) (255 * pow((i + 0.5)/255.5, var->value) + 0.5), 255) << 8;
|
||||
vid_gamma_green[i] = vid_gamma_red[i];
|
||||
vid_gamma_blue[i] = vid_gamma_red[i];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue