Skip to content

Commit a6ba930

Browse files
committed
rg_display: fixed rg_display_clear_rect being obviously wrong
1 parent cae092c commit a6ba930

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

components/retro-go/rg_display.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,12 @@ void rg_display_clear_rect(int left, int top, int width, int height, uint16_t co
606606
if (width < 0 || height < 0)
607607
return;
608608
#if USE_SCREEN_BUFFER
609-
uint16_t *buffer = lcd_get_fb_ptr(left, top);
610-
for (int i = 0; i < pixels_remaining; ++i)
611-
buffer[i] = color_le;
609+
for (int y = 0; y < height; ++y)
610+
{
611+
uint16_t *buffer = lcd_get_fb_ptr(left, top + y);
612+
for (int x = 0; x < width; ++x)
613+
buffer[i] = color_le;
614+
}
612615
#else
613616
const uint16_t color_be = (color_le << 8) | (color_le >> 8);
614617
lcd_set_window(screen_left, screen_top, width, height);

0 commit comments

Comments
 (0)