From a27cb814527d5bd8d4f13f0fc695dea8ef906352 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 4 Sep 2004 18:07:54 +0000 Subject: [PATCH] Support q2 transparency properly. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@137 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_rsurf.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/engine/gl/gl_rsurf.c b/engine/gl/gl_rsurf.c index b8d72a812..5eaed1b27 100644 --- a/engine/gl/gl_rsurf.c +++ b/engine/gl/gl_rsurf.c @@ -1570,7 +1570,7 @@ void R_RenderBrushPoly (msurface_t *fa) if (fa->flags & SURF_DRAWTURB) { // warp texture, no lightmaps - EmitWaterPolys (fa); + EmitWaterPolys (fa, r_wateralphaval); glDisable(GL_BLEND); //to ensure. return; } @@ -1754,7 +1754,7 @@ void GLR_DrawWaterSurfaces (void) GL_Bind (t->gl_texturenum); for ( ; s ; s=s->texturechain) - EmitWaterPolys (s); + EmitWaterPolys (s, r_wateralphaval); t->texturechain = NULL; } @@ -1788,7 +1788,7 @@ static void GLR_DrawAlphaSurface(msurface_t *s) if (s->flags & SURF_DRAWTURB) { glColor4f (1,1,1,1); - EmitWaterPolys (s); + EmitWaterPolys (s, r_wateralphaval); } else { @@ -1833,8 +1833,8 @@ static void GLR_DrawAlphaSurface(msurface_t *s) return; } - if (s->flags & SURF_DRAWTURB) - EmitWaterPolys (s); + if (s->flags & SURF_DRAWTURB || s->texinfo->flags & SURF_WARP) + EmitWaterPolys (s, r_wateralphaval); // else if(s->texinfo->flags & SURF_FLOWING) // PGM 9/16/98 // DrawGLFlowingPoly (s); // PGM else @@ -1857,11 +1857,12 @@ void GLR_DrawAlphaSurfaces (void) glEnable(GL_ALPHA_TEST); glDisable(GL_BLEND); - if (cl.worldmodel && cl.worldmodel->fromgame == fg_quake3) + if (cl.worldmodel && (cl.worldmodel->fromgame == fg_quake3|| cl.worldmodel->fromgame == fg_quake2)) { //this is a mahoosive hack. //we need to use different blending modes for lights and 'rugs'... //we could do this by seeing if a texture includes alpha - rug, or if it's fully solid - light. - glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_COLOR); + if (cl.worldmodel->fromgame == fg_quake3) + glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_COLOR); glDepthMask(0); //this makes no difference to the cheating. glDisable(GL_ALPHA_TEST);