use NotPreservedBitmap for game console

This commit is contained in:
Sebastian Krzyszkowiak 2017-06-13 14:17:38 +02:00
parent d3f876097f
commit 7241476886
2 changed files with 4 additions and 2 deletions

View file

@ -128,8 +128,8 @@ SYMBOL_INTERNAL void Console_Load(struct Game *game) {
if (!game->viewport.integer_scaling) { if (!game->viewport.integer_scaling) {
width = (al_get_display_width(game->display) / (float)game->viewport.width) * game->viewport.width; 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 = CreateNotPreservedBitmap(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_tmp = CreateNotPreservedBitmap(width, al_get_font_line_height(game->_priv.font_console)*5);
al_set_target_bitmap(game->_priv.console); al_set_target_bitmap(game->_priv.console);
al_clear_to_color(al_map_rgba(0,0,0,80)); al_clear_to_color(al_map_rgba(0,0,0,80));
al_set_target_bitmap(al_get_backbuffer(game->display)); al_set_target_bitmap(al_get_backbuffer(game->display));

View file

@ -420,11 +420,13 @@ SYMBOL_EXPORT int libsuperderpy_run(struct Game *game) {
al_stop_timer(game->_priv.timer); al_stop_timer(game->_priv.timer);
al_detach_voice(game->audio.v); al_detach_voice(game->audio.v);
FreezeGamestates(game); FreezeGamestates(game);
if (game->_priv.console) Console_Unload(game);
al_acknowledge_drawing_halt(game->display); al_acknowledge_drawing_halt(game->display);
} }
else if(ev.type == ALLEGRO_EVENT_DISPLAY_RESUME_DRAWING) { else if(ev.type == ALLEGRO_EVENT_DISPLAY_RESUME_DRAWING) {
game->_priv.draw = true; game->_priv.draw = true;
al_acknowledge_drawing_resume(game->display); al_acknowledge_drawing_resume(game->display);
Console_Load(game);
PrintConsole(game, "Engine resumed."); PrintConsole(game, "Engine resumed.");
ReloadGamestates(game); ReloadGamestates(game);
UnfreezeGamestates(game); UnfreezeGamestates(game);