From 8c4253ec8c56bfc2e31069e9651091a7d671f376 Mon Sep 17 00:00:00 2001 From: Molgrum Date: Tue, 21 Aug 2007 18:42:42 +0000 Subject: [PATCH] Check this diff and revert it if you can find any purpose of vid_gamma and the pow()-calls with exponent 1.0 being in the code. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2604 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/gl_q2bsp.c | 6 ++---- engine/d3d9/vid_d3d9.c | 3 --- engine/gl/gl_rmain.c | 3 --- engine/gl/gl_vidlinuxglx.c | 1 - engine/gl/gl_vidmorphos.c | 2 -- engine/gl/gl_vidnt.c | 2 -- engine/gl/gl_vidsdl.c | 1 - 7 files changed, 2 insertions(+), 16 deletions(-) diff --git a/engine/common/gl_q2bsp.c b/engine/common/gl_q2bsp.c index bbd01b6c5..c93be4fbf 100644 --- a/engine/common/gl_q2bsp.c +++ b/engine/common/gl_q2bsp.c @@ -3477,8 +3477,7 @@ int CM_GetQ2Palette (void) #if defined(RGLQUAKE) || defined(D3DQUAKE) { - extern float vid_gamma; - float f, inf; + float inf; qbyte palette[768]; qbyte *pal; int i; @@ -3487,8 +3486,7 @@ int CM_GetQ2Palette (void) for (i=0 ; i<768 ; i++) { - f = pow ( (pal[i]+1)/256.0 , vid_gamma ); - inf = f*255 + 0.5; + inf = ((pal[i]+1)/256.0)*255 + 0.5; if (inf < 0) inf = 0; if (inf > 255) diff --git a/engine/d3d9/vid_d3d9.c b/engine/d3d9/vid_d3d9.c index 3a78bfd6d..4b3b82ce9 100644 --- a/engine/d3d9/vid_d3d9.c +++ b/engine/d3d9/vid_d3d9.c @@ -1068,7 +1068,6 @@ index_t d3d9quadindexes[6] = { }; extern cvar_t gl_contrast; - float vid_gamma = 1.0; float f; unsigned int colour; @@ -1080,8 +1079,6 @@ extern cvar_t gl_contrast; f = gl_contrast.value; f = min (f, 3); - f = pow (f, vid_gamma); - IDirect3DDevice9_SetTexture (pD3DDev9, 0, NULL); IDirect3DDevice9_SetRenderState(pD3DDev9, D3DRS_ALPHABLENDENABLE, TRUE); IDirect3DDevice9_SetRenderState(pD3DDev9, D3DRS_SRCBLEND, D3DBLEND_DESTCOLOR); diff --git a/engine/gl/gl_rmain.c b/engine/gl/gl_rmain.c index 4f043c6c0..45e0734dc 100644 --- a/engine/gl/gl_rmain.c +++ b/engine/gl/gl_rmain.c @@ -819,7 +819,6 @@ void R_PolyBlend (void) void GLR_BrightenScreen (void) { - extern float vid_gamma; float f; RSpeedMark(); @@ -830,8 +829,6 @@ void GLR_BrightenScreen (void) f = gl_contrast.value; f = min (f, 3); - f = pow (f, vid_gamma); - qglDisable (GL_TEXTURE_2D); qglEnable (GL_BLEND); qglBlendFunc (GL_DST_COLOR, GL_ONE); diff --git a/engine/gl/gl_vidlinuxglx.c b/engine/gl/gl_vidlinuxglx.c index 53ddf7be6..976422746 100644 --- a/engine/gl/gl_vidlinuxglx.c +++ b/engine/gl/gl_vidlinuxglx.c @@ -113,7 +113,6 @@ const char *gl_extensions; qboolean is8bit = false; qboolean isPermedia = false; -float vid_gamma = 1.0; qboolean mouseactive = false; qboolean ActiveApp = false; diff --git a/engine/gl/gl_vidmorphos.c b/engine/gl/gl_vidmorphos.c index b13c567d5..7f09ef2dd 100644 --- a/engine/gl/gl_vidmorphos.c +++ b/engine/gl/gl_vidmorphos.c @@ -28,8 +28,6 @@ struct Library *TinyGLBase = 0; GLContext *__tglContext; static int glctx = 0; -float vid_gamma = 1.0; - unsigned char *mosgammatable; struct Window *window; diff --git a/engine/gl/gl_vidnt.c b/engine/gl/gl_vidnt.c index 5a3f926b1..351d20a82 100644 --- a/engine/gl/gl_vidnt.c +++ b/engine/gl/gl_vidnt.c @@ -106,8 +106,6 @@ HWND mainwindow, dibwindow; unsigned char vid_curpal[256*3]; -float vid_gamma = 1.0; - HGLRC baseRC; HDC maindc; diff --git a/engine/gl/gl_vidsdl.c b/engine/gl/gl_vidsdl.c index 067138a51..215197b81 100644 --- a/engine/gl/gl_vidsdl.c +++ b/engine/gl/gl_vidsdl.c @@ -11,7 +11,6 @@ extern int gammaworks; int glwidth; int glheight; -float vid_gamma = 1.0; #ifdef _WIN32 //half the rest of the code uses windows apis to focus windows. Should be fixed, but it's not too important. HWND mainwindow;