From f24dc119ffd4fb129c10264812ab650df75910f9 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 23 Apr 2010 18:50:12 -0300 Subject: [PATCH] Some PRINTFs in gui_flip_screen() to catch the lost screen bug. --- src/modules/gui.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/gui.cpp b/src/modules/gui.cpp index 3554db6b9..3ab4aa6bf 100644 --- a/src/modules/gui.cpp +++ b/src/modules/gui.cpp @@ -538,11 +538,16 @@ void gui_flip_screen() // This is a strange Allegro bug where the "screen" pointer is lost, // so we have to reconstruct it changing the gfx mode again else if (screen == NULL) { + PRINTF("Gfx mode lost, trying to restore gfx mode...\n"); + if (!lastWorkingGfxMode.setGfxMode()) { + PRINTF("Fatal error\n"); set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); user_printf(_("FATAL ERROR: Unable to restore the old graphics mode!\n")); exit(1); } + + PRINTF("Successfully restored\n"); } else lastWorkingGfxMode.updateWithCurrentMode();