From 6abac2b717bea19c4d9b1c178a129fb3c82142ba Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Tue, 21 Nov 2000 09:12:21 +0000 Subject: [PATCH] fixed duplicate application of gamma correction git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@95 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_textures.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/gl_textures.c b/gl_textures.c index 345a7414..83444e52 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -173,17 +173,25 @@ void GL_ResampleTextureLerpLine (byte *in, byte *out, int inwidth, int outwidth) { l2 = f & 0xFFFF; l1 = 0x10000 - l2; - *out++ = qgamma[(byte) ((in[0] * l1 + in[4] * l2) >> 16)]; - *out++ = qgamma[(byte) ((in[1] * l1 + in[5] * l2) >> 16)]; - *out++ = qgamma[(byte) ((in[2] * l1 + in[6] * l2) >> 16)]; - *out++ = (byte) ((in[3] * l1 + in[7] * l2) >> 16) ; + *out++ = (byte) ((in[0] * l1 + in[4] * l2) >> 16); + *out++ = (byte) ((in[1] * l1 + in[5] * l2) >> 16); + *out++ = (byte) ((in[2] * l1 + in[6] * l2) >> 16); + *out++ = (byte) ((in[3] * l1 + in[7] * l2) >> 16); +// *out++ = qgamma[(byte) ((in[0] * l1 + in[4] * l2) >> 16)]; +// *out++ = qgamma[(byte) ((in[1] * l1 + in[5] * l2) >> 16)]; +// *out++ = qgamma[(byte) ((in[2] * l1 + in[6] * l2) >> 16)]; +// *out++ = (byte) ((in[3] * l1 + in[7] * l2) >> 16) ; } else // last pixel of the line has no pixel to lerp to { - *out++ = qgamma[in[0]]; - *out++ = qgamma[in[1]]; - *out++ = qgamma[in[2]]; - *out++ = in[3] ; + *out++ = in[0]; + *out++ = in[1]; + *out++ = in[2]; + *out++ = in[3]; +// *out++ = qgamma[in[0]]; +// *out++ = qgamma[in[1]]; +// *out++ = qgamma[in[2]]; +// *out++ = in[3] ; } } } -- 2.39.2