From e424ef63f2c6c4e42d7d06eb0037fd80f48bceb2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 27 Aug 2017 09:58:25 +0200 Subject: [PATCH] - fixed: Sprites drawn in the opaque pass still need to set their texture mode so that they can be drawn with STYLE_Stencil. --- src/gl/scene/gl_sprite.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index b290533830..5ca2cd65d2 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -321,6 +321,12 @@ void GLSprite::Draw(int pass) } else if (modelframe == nullptr) { + int tm, sb, db, be; + + // This still needs to set the texture mode. As blend mode it will always use GL_ONE/GL_ZERO + gl_GetRenderStyle(RenderStyle, false, false, &tm, &sb, &db, &be); + gl_RenderState.SetTextureMode(tm); + glEnable(GL_POLYGON_OFFSET_FILL); glPolygonOffset(-1.0f, -128.0f); }