Skip to content

Commit c380978

Browse files
author
CubeCoders
committed
Fix #5: HALF_WIDTH_BUFFERS+FIELD_BUFFERS=0 clear loop now covers full buffer height
1 parent b7bc500 commit c380978

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/Scene.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,18 @@ void PERF_CRITICAL Scene::clearBuffers() {
337337
// we'd get backcolor's low byte duplicated. Pack two pixels per
338338
// 32-bit store and walk rows so the gradient (if any) actually
339339
// shows up.
340+
// HALF_WIDTH_BUFFERS makes the buffer half-width. FIELD_BUFFERS
341+
// additionally halves the height (each field buffer covers every other
342+
// row). When only HALF_WIDTH_BUFFERS is set the buffer is half-width
343+
// but FULL-height, so rowCount must be screenHeight in that case.
340344
#if HALF_WIDTH_BUFFERS
341345
const int rowPixels = screenWidth / 2;
346+
#if FIELD_BUFFERS
342347
const int rowCount = screenHeight / 2;
343348
#else
349+
const int rowCount = screenHeight;
350+
#endif
351+
#else
344352
const int rowPixels = screenWidth;
345353
const int rowCount = screenHeight;
346354
#endif

0 commit comments

Comments
 (0)