1
0
Fork 0

(svn r22921) -Fix: [OSX] Don't allow the old fullscreen mode also not as fallback on OSX 10.7. Also add a few sprinkles of coding style accross cocoa display drivers

release/1.2
planetmaker 2011-09-11 12:52:44 +00:00
parent 40d5419cd2
commit 58f00d786c
2 changed files with 21 additions and 22 deletions

View File

@ -241,23 +241,20 @@ static CocoaSubdriver *QZ_CreateWindowSubdriver(int width, int height, int bpp)
CocoaSubdriver *ret; CocoaSubdriver *ret;
#endif #endif
#ifdef ENABLE_COCOA_QUARTZ #ifdef ENABLE_COCOA_QUARTZ && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
/* The reason for the version mismatch is due to the fact that the 10.4 binary needs to work on 10.5 as well. */ /* The reason for the version mismatch is due to the fact that the 10.4 binary needs to work on 10.5 as well. */
if (MacOSVersionIsAtLeast(10, 5, 0)) { if (MacOSVersionIsAtLeast(10, 5, 0)) {
ret = QZ_CreateWindowQuartzSubdriver(width, height, bpp); ret = QZ_CreateWindowQuartzSubdriver(width, height, bpp);
if (ret != NULL) return ret; if (ret != NULL) return ret;
} }
#endif #endif
#endif
#ifdef ENABLE_COCOA_QUICKDRAW #ifdef ENABLE_COCOA_QUICKDRAW
ret = QZ_CreateWindowQuickdrawSubdriver(width, height, bpp); ret = QZ_CreateWindowQuickdrawSubdriver(width, height, bpp);
if (ret != NULL) return ret; if (ret != NULL) return ret;
#endif #endif
#ifdef ENABLE_COCOA_QUARTZ #ifdef ENABLE_COCOA_QUARTZ && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
/* /*
* If we get here we are running 10.4 or earlier and either openttd was compiled without the QuickDraw driver * If we get here we are running 10.4 or earlier and either openttd was compiled without the QuickDraw driver
* or it failed to load for some reason. Fall back to Quartz if possible even though that driver is slower. * or it failed to load for some reason. Fall back to Quartz if possible even though that driver is slower.
@ -266,7 +263,6 @@ static CocoaSubdriver *QZ_CreateWindowSubdriver(int width, int height, int bpp)
ret = QZ_CreateWindowQuartzSubdriver(width, height, bpp); ret = QZ_CreateWindowQuartzSubdriver(width, height, bpp);
if (ret != NULL) return ret; if (ret != NULL) return ret;
} }
#endif
#endif #endif
return NULL; return NULL;
@ -307,11 +303,14 @@ static CocoaSubdriver *QZ_CreateSubdriver(int width, int height, int bpp, bool f
ret = QZ_CreateWindowSubdriver(640, 480, bpp); ret = QZ_CreateWindowSubdriver(640, 480, bpp);
if (ret != NULL) return ret; if (ret != NULL) return ret;
#ifdef _DEBUG && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) #ifdef _DEBUG
/* This Fullscreen mode crashes on OSX 10.7 */
if !(MacOSVersionIsAtLeast(10, 7, 0) {
/* Try fullscreen too when in debug mode */ /* Try fullscreen too when in debug mode */
DEBUG(driver, 0, "Setting video mode failed, falling back to 640x480 fullscreen mode."); DEBUG(driver, 0, "Setting video mode failed, falling back to 640x480 fullscreen mode.");
ret = QZ_CreateFullscreenSubdriver(640, 480, bpp); ret = QZ_CreateFullscreenSubdriver(640, 480, bpp);
if (ret != NULL) return ret; if (ret != NULL) return ret;
}
#endif #endif
return NULL; return NULL;