add an overdraw buffer to allow for layered rendering
This commit is contained in:
@@ -10,20 +10,22 @@
|
||||
*/
|
||||
void
|
||||
put_rect(
|
||||
framebuffer_e framebuffer,
|
||||
uint32_t x,
|
||||
uint32_t y,
|
||||
uint32_t w,
|
||||
uint32_t h,
|
||||
uint32_t color
|
||||
) {
|
||||
) {
|
||||
for (int i = x; i < x + w; i++) {
|
||||
for (int j = y; j < y + h; j++) {
|
||||
put_pixel(i, j, color);
|
||||
put_pixel(framebuffer, i, j, color);
|
||||
}
|
||||
}
|
||||
mark_dirty_rect(x, y, w, h);
|
||||
}
|
||||
|
||||
// TODO: remove, see rect.h
|
||||
void
|
||||
clear_rect(int x, int y, int w, int h, uint32_t color)
|
||||
{
|
||||
@@ -33,7 +35,7 @@ clear_rect(int x, int y, int w, int h, uint32_t color)
|
||||
px < game_state->width &&
|
||||
py >= 0 &&
|
||||
py < game_state->height) {
|
||||
game_state->framebuffer[
|
||||
game_state->framebuffer_base[
|
||||
py * game_state->width + px
|
||||
] = color;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user