From 7241476886673fa631bd73b9ad60c3e7150803c8 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Tue, 13 Jun 2017 14:17:38 +0200 Subject: [PATCH] use NotPreservedBitmap for game console --- src/internal.c | 4 ++-- src/libsuperderpy.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index dc159f4..c556b83 100644 --- a/src/internal.c +++ b/src/internal.c @@ -128,8 +128,8 @@ SYMBOL_INTERNAL void Console_Load(struct Game *game) { if (!game->viewport.integer_scaling) { width = (al_get_display_width(game->display) / (float)game->viewport.width) * game->viewport.width; } - game->_priv.console = al_create_bitmap(width, al_get_font_line_height(game->_priv.font_console)*5); - game->_priv.console_tmp = al_create_bitmap(width, al_get_font_line_height(game->_priv.font_console)*5); + game->_priv.console = CreateNotPreservedBitmap(width, al_get_font_line_height(game->_priv.font_console)*5); + game->_priv.console_tmp = CreateNotPreservedBitmap(width, al_get_font_line_height(game->_priv.font_console)*5); al_set_target_bitmap(game->_priv.console); al_clear_to_color(al_map_rgba(0,0,0,80)); al_set_target_bitmap(al_get_backbuffer(game->display)); diff --git a/src/libsuperderpy.c b/src/libsuperderpy.c index 6285032..740fbc2 100644 --- a/src/libsuperderpy.c +++ b/src/libsuperderpy.c @@ -420,11 +420,13 @@ SYMBOL_EXPORT int libsuperderpy_run(struct Game *game) { al_stop_timer(game->_priv.timer); al_detach_voice(game->audio.v); FreezeGamestates(game); + if (game->_priv.console) Console_Unload(game); al_acknowledge_drawing_halt(game->display); } else if(ev.type == ALLEGRO_EVENT_DISPLAY_RESUME_DRAWING) { game->_priv.draw = true; al_acknowledge_drawing_resume(game->display); + Console_Load(game); PrintConsole(game, "Engine resumed."); ReloadGamestates(game); UnfreezeGamestates(game);