From f94930b5d51d43a2d4c819698cdcfd9a74083041 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Mon, 4 Sep 2017 16:02:49 +0200 Subject: [PATCH] PrintConsole: restore previous target bitmap instead of reseting to backbuffer --- src/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.c b/src/utils.c index 921c58a..9fe69af 100644 --- a/src/utils.c +++ b/src/utils.c @@ -382,6 +382,7 @@ SYMBOL_EXPORT void PrintConsole(struct Game *game, char* format, ...) { if (!game->_priv.draw) return; if (!game->_priv.console) return; if ((!game->config.debug) && (!game->_priv.showconsole)) return; + ALLEGRO_BITMAP *target = al_get_target_bitmap(); al_set_target_bitmap(game->_priv.console_tmp); al_clear_to_color(al_map_rgba(0,0,0,80)); al_draw_bitmap_region(game->_priv.console, 0, (int)(al_get_bitmap_height(game->_priv.console)*0.2), al_get_bitmap_width(game->_priv.console), (int)(al_get_bitmap_height(game->_priv.console)*0.8), 0, 0, 0); @@ -389,7 +390,7 @@ SYMBOL_EXPORT void PrintConsole(struct Game *game, char* format, ...) { al_set_target_bitmap(game->_priv.console); al_clear_to_color(al_map_rgba(0,0,0,0)); al_draw_bitmap(game->_priv.console_tmp, 0, 0, 0); - al_set_target_bitmap(al_get_backbuffer(game->display)); + al_set_target_bitmap(target); } SYMBOL_EXPORT void SetupViewport(struct Game *game, struct Viewport config) {