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