mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Flush OpenGL command buffers before drawing a rectangle instead of after
This fixes an issue causing the first rectangle that is being drawn to not be over whatever was previously drawn.
This commit is contained in:
@@ -561,6 +561,9 @@ void OpenGLDrawingContext::Clear(uint8 paletteIndex)
|
||||
|
||||
void OpenGLDrawingContext::FillRect(uint32 colour, sint32 left, sint32 top, sint32 right, sint32 bottom)
|
||||
{
|
||||
// Must be rendered in order, depends on already rendered contents
|
||||
FlushCommandBuffers();
|
||||
|
||||
left += _offsetX;
|
||||
top += _offsetY;
|
||||
right += _offsetX;
|
||||
@@ -601,13 +604,13 @@ void OpenGLDrawingContext::FillRect(uint32 colour, sint32 left, sint32 top, sint
|
||||
command.bounds[3] = bottom + 1;
|
||||
|
||||
_commandBuffers.rectangles.push_back(command);
|
||||
|
||||
// Must be rendered in order, depends on already rendered contents
|
||||
FlushCommandBuffers();
|
||||
}
|
||||
|
||||
void OpenGLDrawingContext::FilterRect(FILTER_PALETTE_ID palette, sint32 left, sint32 top, sint32 right, sint32 bottom)
|
||||
{
|
||||
// Must be rendered in order, depends on already rendered contents
|
||||
FlushCommandBuffers();
|
||||
|
||||
left += _offsetX;
|
||||
top += _offsetY;
|
||||
right += _offsetX;
|
||||
@@ -643,9 +646,6 @@ void OpenGLDrawingContext::FilterRect(FILTER_PALETTE_ID palette, sint32 left, si
|
||||
command.bounds[3] = bottom + 1;
|
||||
|
||||
_commandBuffers.rectangles.push_back(command);
|
||||
|
||||
// Must be rendered in order, depends on already rendered contents
|
||||
FlushCommandBuffers();
|
||||
}
|
||||
|
||||
void OpenGLDrawingContext::DrawLine(uint32 colour, sint32 x1, sint32 y1, sint32 x2, sint32 y2)
|
||||
|
||||
Reference in New Issue
Block a user