Fix clipping in FlushImages

This commit is contained in:
Alexander Overvoorde 2016-07-22 22:20:16 +02:00
parent 09b07174e3
commit afd83fa13d
1 changed files with 4 additions and 1 deletions

View File

@ -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);