diff options
author | Bad Diode <bd@badd10de.dev> | 2021-06-06 12:40:11 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-06-06 12:40:11 +0200 |
commit | dc3a5260602357da1192ebc9f1f72bb436d1df00 (patch) | |
tree | 3aee0b8d9ee33dd37445103402738a60e16f309f /src | |
parent | b6d5c2a326e39063977dd546690a74e8cce24143 (diff) | |
download | stepper-dc3a5260602357da1192ebc9f1f72bb436d1df00.tar.gz stepper-dc3a5260602357da1192ebc9f1f72bb436d1df00.zip |
Add clear screen function to renderer
Diffstat (limited to 'src')
-rw-r--r-- | src/renderer.c | 5 | ||||
-rw-r--r-- | src/renderer.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/renderer.c b/src/renderer.c index 3072105..d587d01 100644 --- a/src/renderer.c +++ b/src/renderer.c | |||
@@ -346,6 +346,11 @@ draw_tile(size_t x, size_t y, Tile *tile, bool merge) { | |||
346 | } | 346 | } |
347 | } | 347 | } |
348 | 348 | ||
349 | void | ||
350 | clear_screen(void) { | ||
351 | dma_fill(FRONTBUF, 0, KB(20), 3); | ||
352 | } | ||
353 | |||
349 | IWRAM_CODE | 354 | IWRAM_CODE |
350 | void | 355 | void |
351 | flip_buffer(void) { | 356 | flip_buffer(void) { |
diff --git a/src/renderer.h b/src/renderer.h index fd48bcf..a240b17 100644 --- a/src/renderer.h +++ b/src/renderer.h | |||
@@ -46,6 +46,9 @@ void draw_filled_rect(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr); | |||
46 | // some merging issues if we are not careful with the chosen colors. | 46 | // some merging issues if we are not careful with the chosen colors. |
47 | void draw_tile(size_t x, size_t y, Tile *tile, bool merge); | 47 | void draw_tile(size_t x, size_t y, Tile *tile, bool merge); |
48 | 48 | ||
49 | // Fills the framebuffer with color 0. | ||
50 | void clear_screen(void); | ||
51 | |||
49 | // Copies the content of dirty tiles from the backbuffer into the frontbuffer. | 52 | // Copies the content of dirty tiles from the backbuffer into the frontbuffer. |
50 | // To be called exactly once at the beginning of the VBlank. | 53 | // To be called exactly once at the beginning of the VBlank. |
51 | void flip_buffer(void); | 54 | void flip_buffer(void); |