From 0f887ea419458c15c0e1c35b8ee917623b88b69e Mon Sep 17 00:00:00 2001 From: attilavs2 Date: Thu, 1 Aug 2024 15:28:49 +0200 Subject: [PATCH] =?UTF-8?q?rendu=20:=20Suppresion=20de=20dclear()s=20non?= =?UTF-8?q?=20n=C3=A9c=C3=A9ssaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/game.c | 7 +++++-- src/main.c | 3 --- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game.c b/src/game.c index bd918ae..744223d 100644 --- a/src/game.c +++ b/src/game.c @@ -98,9 +98,12 @@ void game_render_indicator(Game *game) { } } +/* Draw everything. */ void game_draw(Game *game) { - /* Draw everything. */ - dclear(C_WHITE); + /*Only clear if we are inside, the screen is guaranteed to be filled + * otherwise */ + if(game->map_level->indoor) + dclear(C_WHITE); map_render_by_layer(game, BACKGROUND); npc_draw(game); player_draw(game); diff --git a/src/main.c b/src/main.c index 6029129..b5e5dc4 100644 --- a/src/main.c +++ b/src/main.c @@ -130,9 +130,6 @@ int main(void) { #endif do { - /* clear screen */ - dclear(C_WHITE); - /* render the map */ game_draw(&game);