mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
graphics: fix recursion when creating a default texture.
This commit is contained in:
@@ -1927,7 +1927,7 @@ void Graphics::flushBatchedDraws()
|
||||
{
|
||||
auto &sbstate = batchedDrawState;
|
||||
|
||||
if (sbstate.vertexCount == 0 && sbstate.indexCount == 0)
|
||||
if (sbstate.vertexCount == 0 && sbstate.indexCount == 0 || sbstate.flushing)
|
||||
return;
|
||||
|
||||
VertexAttributes attributes;
|
||||
@@ -1952,6 +1952,8 @@ void Graphics::flushBatchedDraws()
|
||||
if (attributes.enableBits == 0)
|
||||
return;
|
||||
|
||||
sbstate.flushing = true;
|
||||
|
||||
Colorf nc = getColor();
|
||||
if (attributes.isEnabled(ATTRIB_COLOR))
|
||||
setColor(Colorf(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
@@ -1996,8 +1998,9 @@ void Graphics::flushBatchedDraws()
|
||||
if (attributes.isEnabled(ATTRIB_COLOR))
|
||||
setColor(nc);
|
||||
|
||||
batchedDrawState.vertexCount = 0;
|
||||
batchedDrawState.indexCount = 0;
|
||||
sbstate.vertexCount = 0;
|
||||
sbstate.indexCount = 0;
|
||||
sbstate.flushing = false;
|
||||
}
|
||||
|
||||
void Graphics::flushBatchedDrawsGlobal()
|
||||
|
||||
Reference in New Issue
Block a user