From 354d945b49fa463634fefe1dbd7d5aeb9aed22b4 Mon Sep 17 00:00:00 2001 From: David Capello Date: Sat, 23 Aug 2014 14:17:13 -0300 Subject: [PATCH] Fix initial crash on Mac OS X version when there isn't .asepriterc file and our desktop resolution is 1024x768 Now, a set_gfx_mode() (in Mac OS X) can accept almost any resolution, the screen will be created with the NSView bounds anyway (which can be smaller than the given size in set_gfx_mode()). --- src/allegro/src/macosx/qzwindow.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/allegro/src/macosx/qzwindow.m b/src/allegro/src/macosx/qzwindow.m index bb1f57982..3357fa5cc 100644 --- a/src/allegro/src/macosx/qzwindow.m +++ b/src/allegro/src/macosx/qzwindow.m @@ -535,6 +535,8 @@ static BITMAP *private_osx_qz_window_init(int w, int h, int v_w, int v_h, int co setup_direct_shifts(); + w = [qd_view bounds].size.width; + h = [qd_view bounds].size.height; private_osx_create_screen_data(w, h, color_depth); requested_color_depth = color_depth; @@ -826,6 +828,8 @@ static BITMAP* osx_qz_window_acknowledge_resize(void) [qd_view setFrameSize: NSMakeSize(w, h)]; /* re-create the screen */ + w = [qd_view bounds].size.width; + h = [qd_view bounds].size.height; new_screen = private_osx_create_screen_data(w, h, color_depth); _unix_unlock_mutex(osx_window_mutex);