From daa7adde147c1024c94fbd246ef7c765064dda07 Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 20 Aug 2014 08:27:11 -0300 Subject: [PATCH] Fix #344 initial black screen on Mac OS X and small initial window size on Linux when .asepriterc is not present --- src/app/modules/gui.cpp | 15 +++++++++------ src/she/alleg4/she_alleg4.cpp | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/app/modules/gui.cpp b/src/app/modules/gui.cpp index f2c6d38c5..5af98f735 100644 --- a/src/app/modules/gui.cpp +++ b/src/app/modules/gui.cpp @@ -153,19 +153,22 @@ static void save_gui_config(); // Initializes GUI. int init_module_gui() { - int c, w, h, min_possible_dsk_res = 0; - bool maximized; - shortcuts = new std::vector; - // Set the graphics mode... + int w, h; + bool maximized; load_gui_config(w, h, maximized); try { - main_display = she::instance()->createDisplay(w, h, screen_scaling); + if (w > 0 && h > 0) + main_display = she::instance()->createDisplay(w, h, screen_scaling); } catch (const she::DisplayCreationException&) { - for (c=min_possible_dsk_res; try_resolutions[c].width; ++c) { + // Do nothing, the display wasn't created. + } + + if (!main_display) { + for (int c=0; try_resolutions[c].width; ++c) { try { main_display = she::instance()->createDisplay(try_resolutions[c].width, diff --git a/src/she/alleg4/she_alleg4.cpp b/src/she/alleg4/she_alleg4.cpp index 7a2b8f5a4..ba2f89a11 100644 --- a/src/she/alleg4/she_alleg4.cpp +++ b/src/she/alleg4/she_alleg4.cpp @@ -679,6 +679,7 @@ public: } Display* createDisplay(int width, int height, int scale) override { + PRINTF("Creating display %dx%d (scale = %d)\n", width, height, scale); return new Alleg4Display(width, height, scale); }