From afd83fa13d09315814327000b57e0027f192870f Mon Sep 17 00:00:00 2001 From: Alexander Overvoorde Date: Fri, 22 Jul 2016 22:20:16 +0200 Subject: [PATCH] Fix clipping in FlushImages --- src/drawing/engines/opengl/OpenGLDrawingEngine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 6d52a9b854..c5e3bace6a 100644 --- a/src/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -793,6 +793,9 @@ void OpenGLDrawingContext::DrawSpriteRawMasked(sint32 x, sint32 y, uint32 maskIm command.bounds[3] = bottom; _commandBuffers.maskedImages.push_back(command); + + // Currently not properly ordered with regular images yet + FlushCommandBuffers(); } void OpenGLDrawingContext::DrawSpriteSolid(uint32 image, sint32 x, sint32 y, uint8 colour) @@ -934,7 +937,7 @@ void OpenGLDrawingContext::FlushLines() { void OpenGLDrawingContext::FlushImages() { for (const auto& command : _commandBuffers.images) { _drawImageShader->Use(); - _drawImageShader->SetClip(_clipLeft, _clipTop, _clipRight, _clipBottom); + _drawImageShader->SetClip(command.clip[0], command.clip[1], command.clip[2], command.clip[3]); _drawImageShader->SetTexture(command.texColour); _drawImageShader->SetFlags(command.flags); _drawImageShader->SetColour(command.colour);