Optimisation du rendu

This commit is contained in:
attilavs2 2024-07-30 17:49:40 +02:00
parent 5eb1d18ea7
commit 1daa58723c
2 changed files with 5 additions and 6 deletions

View file

@ -7,6 +7,7 @@
#include <gint/cpu.h> #include <gint/cpu.h>
#include <gint/display.h> #include <gint/display.h>
#include <gint/keyboard.h> #include <gint/keyboard.h>
#include <libprof.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -78,8 +79,6 @@ void game_render_indicator(Game *game) {
} }
void game_draw(Game *game) { void game_draw(Game *game) {
/* Draw everything. */
dclear(C_WHITE);
map_render_by_layer(game, BACKGROUND); map_render_by_layer(game, BACKGROUND);
npc_draw(game); npc_draw(game);
player_draw(game); player_draw(game);
@ -89,6 +88,7 @@ void game_draw(Game *game) {
dprint(8, 16, C_BLACK, "Mana: %d", game->mana); dprint(8, 16, C_BLACK, "Mana: %d", game->mana);
} }
/* Key management */ /* Key management */
void game_get_inputs(Game *game) { void game_get_inputs(Game *game) {

View file

@ -120,12 +120,11 @@ int main(void) {
#endif #endif
do { do {
/* clear screen */ /*clears & renders everything */
dclear(C_WHITE);
/* render the map */
game_draw(&game); game_draw(&game);
dprint(0,30,0,"draw time : %d", game.frame_duration);
#if DEBUGMODE && GINT_RENDER_RGB #if DEBUGMODE && GINT_RENDER_RGB
if(game.debug_map) { if(game.debug_map) {
dfont(NULL); dfont(NULL);