From 706f09b2471c33ad4ab55950aec356d1e4f1a386 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 31 Jan 2012 18:08:06 +0900 Subject: [PATCH] Put the transparent surfaces on the water chain. I'd actually done this the first time, but then got confused and forgot the waterchain works with multiple textures. This is actually the right place as all transparent surfaces need to be sorted irrespective to their textures. Really, waterchain needs to be renamed. --- libs/video/renderer/glsl/glsl_bsp.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libs/video/renderer/glsl/glsl_bsp.c b/libs/video/renderer/glsl/glsl_bsp.c index 0fdc8db24..6664cd66a 100644 --- a/libs/video/renderer/glsl/glsl_bsp.c +++ b/libs/video/renderer/glsl/glsl_bsp.c @@ -354,10 +354,10 @@ chain_surface (msurface_t *surf, vec_t *transform, float *color) { instsurf_t *is; - if (surf->flags & SURF_DRAWTURB) { - CHAIN_SURF_B2F (surf, waterchain); - } else if (surf->flags & SURF_DRAWSKY) { + if (surf->flags & SURF_DRAWSKY) { CHAIN_SURF_F2B (surf, sky_chain); + } else if ((surf->flags & SURF_DRAWTURB) || (color && color[3] < 1.0)) { + CHAIN_SURF_B2F (surf, waterchain); } else { texture_t *tex; @@ -365,10 +365,7 @@ chain_surface (msurface_t *surf, vec_t *transform, float *color) tex = surf->texinfo->texture; else tex = R_TextureAnimation (surf); - if (color && color[3] < 1.0) - CHAIN_SURF_B2F (surf, tex->tex_chain); - else - CHAIN_SURF_F2B (surf, tex->tex_chain); + CHAIN_SURF_F2B (surf, tex->tex_chain); update_lightmap (surf); }