From 99c4b6b6d752c8809cca9004d856435965c4b1d8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Jan 2020 18:48:14 +0100 Subject: [PATCH] - don't let environmental palettes (like underwater) affect the HUD and menu. --- source/common/rendering/gl/system/gl_framebuffer.cpp | 4 ++++ source/glbackend/glbackend.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/source/common/rendering/gl/system/gl_framebuffer.cpp b/source/common/rendering/gl/system/gl_framebuffer.cpp index affefa675..77243a103 100644 --- a/source/common/rendering/gl/system/gl_framebuffer.cpp +++ b/source/common/rendering/gl/system/gl_framebuffer.cpp @@ -39,6 +39,7 @@ #include "m_png.h" #include "printf.h" #include "templates.h" +#include "palette.h" #include "glbackend/glbackend.h" #include "gl_load/gl_interface.h" @@ -431,7 +432,10 @@ void OpenGLFrameBuffer::Draw2D() GLRenderer->mBuffers->BindCurrentFB(); ::DrawFullscreenBlends(); DrawRateStuff(); + auto savepal = curbasepal; + if (!GLInterface.NonTransparent255Enabled()) curbasepal = 0; GLInterface.Draw2D(&twodgen); + curbasepal = savepal; } } diff --git a/source/glbackend/glbackend.h b/source/glbackend/glbackend.h index ca281e096..8609f09a2 100644 --- a/source/glbackend/glbackend.h +++ b/source/glbackend/glbackend.h @@ -202,6 +202,10 @@ public: { g_nontransparent255 = on; } + bool NonTransparent255Enabled() + { + return g_nontransparent255; + } void SetVertexBuffer(IVertexBuffer* vb, int offset1, int offset2); void SetIndexBuffer(IIndexBuffer* vb);