From 9fbeb58384f9456e281518cd3a8be7fecadb7ae3 Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 17 Feb 2005 03:30:24 +0000 Subject: [PATCH] Fixing v_cshift with hardware gamma on winnt. winnt sucks. flashbangs are non-cheatie now. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@877 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/view.c | 44 +++++++++++++++++++++++++++++++++++--------- engine/gl/gl_rmain.c | 10 +++++++--- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/engine/client/view.c b/engine/client/view.c index 8431796d5..a31979201 100644 --- a/engine/client/view.c +++ b/engine/client/view.c @@ -586,6 +586,31 @@ V_CalcBlend ============= */ #if defined(RGLQUAKE) + +void GLV_CalcBlendServer (float colors[4]) +{ + extern qboolean gammaworks; + if (gammaworks || !v_blend[3]) + { //regular cshifts work through hardware gamma + //server sent cshifts do not. + colors[0] = cl.cshifts[CSHIFT_SERVER].destcolor[0]/255.0f; + colors[1] = cl.cshifts[CSHIFT_SERVER].destcolor[1]/255.0f; + colors[2] = cl.cshifts[CSHIFT_SERVER].destcolor[2]/255.0f; + colors[3] = cl.cshifts[CSHIFT_SERVER].percent/255.0f; + } + else + { + float na; + na = cl.cshifts[CSHIFT_SERVER].percent/255.0f; + + colors[3] = v_blend[3] + na*(1-v_blend[3]); +//Con_Printf ("j:%i a:%f\n", j, a); + na = na/colors[3]; + colors[0] = v_blend[0]*(1-na) + (cl.cshifts[CSHIFT_SERVER].destcolor[0]/255.0f)*na; + colors[1] = v_blend[1]*(1-na) + (cl.cshifts[CSHIFT_SERVER].destcolor[1]/255.0f)*na; + colors[2] = v_blend[2]*(1-na) + (cl.cshifts[CSHIFT_SERVER].destcolor[2]/255.0f)*na; + } +} void GLV_CalcBlend (void) { float r, g, b, a, a2; @@ -596,19 +621,20 @@ void GLV_CalcBlend (void) b = 0; a = 0; - for (j=0 ; j