diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index 2e4e21e5c..6e51c2702 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -248,6 +248,8 @@ void GLWall::SplitWall(sector_t * frontsector, bool translucent) lights[i].colormap.CopyFrom3DLight(&lightlist[i]); } PutWall(translucent); + lights = NULL; + lightsize = 0; } @@ -543,7 +545,7 @@ void GLWall::DoTexture(int _type,seg_t * seg, int peg, // Add this wall to the render list sector_t * sec = sub? sub->sector : seg->frontsector; - if (sec->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap) PutWall(false); + if (sec->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap || !gltexture) PutWall(false); else SplitWall(sec, false); glseg=glsave; @@ -832,7 +834,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary, // Draw the stuff // // - if (realfront->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap) split.PutWall(translucent); + if (realfront->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap || !gltexture) split.PutWall(translucent); else split.SplitWall(realfront, translucent); t=1; @@ -846,7 +848,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary, // Draw the stuff without splitting // // - if (realfront->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap) PutWall(translucent); + if (realfront->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap || !gltexture) PutWall(translucent); else SplitWall(realfront, translucent); } alpha=1.0f; @@ -958,7 +960,7 @@ void GLWall::BuildFFBlock(seg_t * seg, F3DFloor * rover, sector_t * sec = sub? sub->sector : seg->frontsector; - if (sec->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap) PutWall(translucent); + if (sec->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap || !gltexture) PutWall(translucent); else SplitWall(sec, translucent); alpha=1.0f; diff --git a/src/gl/scene/gl_walls_draw.cpp b/src/gl/scene/gl_walls_draw.cpp index 4bff69238..814bc3545 100644 --- a/src/gl/scene/gl_walls_draw.cpp +++ b/src/gl/scene/gl_walls_draw.cpp @@ -364,12 +364,12 @@ void GLWall::RenderTextured(int rflags) void GLWall::RenderTranslucentWall() { - if (gl_fixedcolormap == CM_DEFAULT && gl_lights && (gl.flags & RFL_BUFFER_STORAGE)) - { - SetupLights(); - } if (gltexture) { + if (gl_fixedcolormap == CM_DEFAULT && gl_lights && (gl.flags & RFL_BUFFER_STORAGE)) + { + SetupLights(); + } if (!gltexture->GetTransparent()) gl_RenderState.AlphaFunc(GL_GEQUAL, gl_mask_threshold); else gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f); if (RenderStyle == STYLE_Add) gl_RenderState.BlendFunc(GL_SRC_ALPHA,GL_ONE); @@ -381,6 +381,7 @@ void GLWall::RenderTranslucentWall() gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f); gl_SetColor(lightlevel, 0, Colormap, fabsf(alpha)); gl_SetFog(lightlevel, 0, &Colormap, RenderStyle == STYLE_Add); + gl_RenderState.EnableTexture(false); RenderWall(RWF_NOSPLIT); gl_RenderState.EnableTexture(true); }