mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
chore(gx): minor clarity improvements in BATCHEDRENDERFONTDESC::RenderBatch
This commit is contained in:
parent
da51f7e4fc
commit
1352f0ba50
@ -173,23 +173,26 @@ void BATCHEDRENDERFONTDESC::RenderBatch() {
|
||||
int32_t sliceOffset = 0;
|
||||
|
||||
while (vertsNeeded) {
|
||||
// Clamp slice vertex count to remaining batch capacity
|
||||
int32_t sliceCount = std::min(vertsNeeded, batchCapacity);
|
||||
|
||||
// Write string vertices within slice to buffer
|
||||
string->WriteGeometry(vertexBuf, lineIndex, sliceOffset, sliceCount);
|
||||
|
||||
vertsNeeded -= sliceCount;
|
||||
sliceOffset += sliceCount;
|
||||
batchCapacity -= sliceCount;
|
||||
sliceOffset += sliceCount;
|
||||
vertexBuf += sliceCount;
|
||||
|
||||
if (!batchCapacity) {
|
||||
// Render full buffer and reset capacity
|
||||
if (batchCapacity == 0) {
|
||||
vertexBuf = this->UnlockVertexPtrAndRender(vertexStream, maxBatchCapacity);
|
||||
batchCapacity = maxBatchCapacity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Render used portion of buffer and reset
|
||||
// Render used portion of buffer and reset capacity
|
||||
if (batchCapacity != maxBatchCapacity) {
|
||||
vertexBuf = this->UnlockVertexPtrAndRender(vertexStream, maxBatchCapacity - batchCapacity);
|
||||
batchCapacity = maxBatchCapacity;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user