Skip to content

Commit dc20ea0

Browse files
Fix multi mode copying mode to next texture and remove set default texture on rlBegin
1 parent 7f1c549 commit dc20ea0

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/rlgl.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,8 +1485,6 @@ void rlBegin(int mode)
14851485
if (RLGL.currentBatch->drawCounter >= RL_DEFAULT_BATCH_DRAWCALLS) rlDrawRenderBatch(RLGL.currentBatch);
14861486

14871487
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].mode = mode;
1488-
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].vertexCount = 0;
1489-
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].textureId = RLGL.State.defaultTextureId;
14901488
}
14911489
}
14921490

@@ -1676,13 +1674,14 @@ void rlSetTexture(unsigned int id)
16761674
RLGL.State.vertexCounter += RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].vertexAlignment;
16771675

16781676
RLGL.currentBatch->drawCounter++;
1677+
1678+
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].mode = RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 2].mode;
1679+
16791680
}
16801681
}
16811682

16821683
if (RLGL.currentBatch->drawCounter >= RL_DEFAULT_BATCH_DRAWCALLS) rlDrawRenderBatch(RLGL.currentBatch);
1683-
if (RLGL.currentBatch->drawCounter > 1) {
1684-
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].mode = RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 2].mode;
1685-
}
1684+
16861685
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].textureId = id;
16871686
RLGL.currentBatch->draws[RLGL.currentBatch->drawCounter - 1].vertexCount = 0;
16881687
}

0 commit comments

Comments
 (0)