Skip to content

Commit 46cd07d

Browse files
committed
WARNING: REVERTED CHANGE THAT BROKE BATCHING!!! #4849
I'm sorry... I did not detect this change was breaking batching... :(
1 parent 266fba1 commit 46cd07d

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/rlgl.h

+1-7
Original file line numberDiff line numberDiff line change
@@ -1459,9 +1459,6 @@ void rlBegin(int mode)
14591459
// NOTE: In all three cases, vertex are accumulated over default internal vertex buffer
14601460
if (RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].mode != mode)
14611461
{
1462-
// Get current binded texture to preserve it between draw modes change (QUADS <--> TRIANGLES)
1463-
int currentTexture = RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].textureId;
1464-
14651462
if (RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].vertexCount > 0)
14661463
{
14671464
// Make sure current RLGL.currentBatch->draws[i].vertexCount is aligned a multiple of 4,
@@ -1484,16 +1481,13 @@ void rlBegin(int mode)
14841481

14851482
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].mode = mode;
14861483
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].vertexCount = 0;
1487-
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].textureId = currentTexture; // Preserve active texture
1484+
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].textureId = RLGL.State.defaultTextureId;
14881485
}
14891486
}
14901487

14911488
// Finish vertex providing
14921489
void rlEnd(void)
14931490
{
1494-
// Reset texture to default
1495-
rlSetTexture(RLGL.State.defaultTextureId);
1496-
14971491
// NOTE: Depth increment is dependant on rlOrtho(): z-near and z-far values,
14981492
// as well as depth buffer bit-depth (16bit or 24bit or 32bit)
14991493
// Correct increment formula would be: depthInc = (zfar - znear)/pow(2, bits)

0 commit comments

Comments
 (0)