add an overdraw buffer to allow for layered rendering
This commit is contained in:
+6
-4
@@ -358,7 +358,8 @@ client_update_framebuffer()
|
||||
// 20, 20, 2, 2, 3, 0x000000, 0xFFFF00
|
||||
// );
|
||||
|
||||
clear_framebuffer(0x000000);
|
||||
// FIXME: why?
|
||||
//clear_framebuffer(BASE, 0x000000);
|
||||
|
||||
uint32_t tile_size = game_state->width / SIZE;
|
||||
uint8_t border_width = 10;
|
||||
@@ -373,7 +374,8 @@ client_update_framebuffer()
|
||||
uint32_t w = tile_size - border_width;
|
||||
uint32_t h = tile_size - border_width;
|
||||
uint32_t background_color = colors(game.area[j][i]);
|
||||
put_rect(x, y, w, h, background_color);
|
||||
put_rect(BASE, x, y, w, h, 0xFFFFFF);
|
||||
put_rect(OVERDRAW, x, y, w, h, background_color);
|
||||
|
||||
// number in foreground
|
||||
uint32_t foreground_color = 0x000000;
|
||||
@@ -389,7 +391,7 @@ client_update_framebuffer()
|
||||
uint32_t n_rev = numrev(n);
|
||||
uint32_t digit_offset = 1;
|
||||
if (n != 0) {
|
||||
put_string(n_str, x + border_width, y + border_width, font_size, digit_offset, 12, foreground_color, background_color);
|
||||
put_string(OVERDRAW, n_str, x + border_width, y + border_width, font_size, digit_offset, 12, foreground_color, background_color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -402,7 +404,7 @@ client_update_framebuffer()
|
||||
alloced = true;
|
||||
|
||||
sprintf(score_text, "score: %6d", game.score);
|
||||
put_string(score_text, border_width / 2, tile_size * SIZE + border_width / 2, 6, 1, 12, 0xFFFFFF, 0x000000);
|
||||
put_string(OVERDRAW, score_text, border_width / 2, tile_size * SIZE + border_width / 2, 6, 1, 12, 0xFFFFFF, 0x000000);
|
||||
|
||||
if (alloced) {
|
||||
free(n_str);
|
||||
|
||||
Reference in New Issue
Block a user