From 859faa4bad04fe55771e9957e6e163b039618666 Mon Sep 17 00:00:00 2001 From: Dennis-Z Date: Fri, 1 Sep 2017 17:21:03 +0200 Subject: [PATCH] Fix ghosting when moving over transparent map elements --- src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.cpp | 1 + src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.h | 1 + src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.cpp index 43f9ec7782..37c738c6b0 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.cpp @@ -114,6 +114,7 @@ static const char * TryLoadAllProcAddresses() SetupOpenGLFunction(glVertexAttribPointer); SetupOpenGLFunction(glDrawArraysInstanced); SetupOpenGLFunction(glVertexAttribDivisor); + SetupOpenGLFunction(glBlendFuncSeparate); return nullptr; } diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.h b/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.h index 35105981a3..246f67d844 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.h +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.h @@ -176,6 +176,7 @@ GLAPI_DECL PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer GLAP GLAPI_DECL PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer GLAPI_SET; GLAPI_DECL PFNGLDRAWARRAYSINSTANCEDPROC glDrawArraysInstanced GLAPI_SET; GLAPI_DECL PFNGLVERTEXATTRIBDIVISORPROC glVertexAttribDivisor GLAPI_SET; +GLAPI_DECL PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate GLAPI_SET; #endif /* OPENGL_NO_LINK */ diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 9f1c182a9c..8f11075e1b 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -186,7 +186,7 @@ public: _drawingContext->Initialise(); glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE); _copyFramebufferShader = new CopyFramebufferShader(); }