commit b111d29
uint
·
2026-06-13 13:01:16 +0000 UTC
parent 5623925
(maus_fb_clear) Scan over flattened framebuffer
1 files changed,
+4,
-5
+4,
-5
1@@ -504,11 +504,10 @@ bool maus_create_window(Maus* mw)
2
3 void maus_fb_clear(Maus* mw, MausColor col)
4 {
5- for (uint32_t y = 0; y < mw->height; y++) {
6- uint32_t* row = mw->bfb + (y * mw->stride);
7- for (uint32_t x = 0; x < mw->width; x++)
8- row[x] = (uint32_t) MAUS_UNPACK_COL(col);
9- }
10+ uint32_t col_up = MAUS_UNPACK_COL(col);
11+ uint32_t pxs = mw->height * mw->width;
12+ for (uint32_t i = 0; i < pxs; i++)
13+ mw->bfb[i] = col_up;
14 }
15
16 Maus* maus_init(const char* title, int x, int y, int width, int height)