summaryrefslogtreecommitdiff
path: root/src/video/cocoa/cocoa_v.mm
diff options
context:
space:
mode:
authoregladil <egladil@openttd.org>2007-12-17 07:47:21 +0000
committeregladil <egladil@openttd.org>2007-12-17 07:47:21 +0000
commit4c3186d2d0f5c3b7e748a68c3f300890fab910cc (patch)
treefdea3d4a12c2e7ff0a33ec90ed275295f25ace28 /src/video/cocoa/cocoa_v.mm
parentd5dbce8331e69109863056ccc4bb90fb4b1b6155 (diff)
downloadopenttd-4c3186d2d0f5c3b7e748a68c3f300890fab910cc.tar.xz
(svn r11653) -Feature: [OSX] Allow windowed mode subdrivers to be disabled at compile time.
Diffstat (limited to 'src/video/cocoa/cocoa_v.mm')
-rw-r--r--src/video/cocoa/cocoa_v.mm17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm
index db8ef2c5b..90434c5d6 100644
--- a/src/video/cocoa/cocoa_v.mm
+++ b/src/video/cocoa/cocoa_v.mm
@@ -232,6 +232,7 @@ static CocoaSubdriver *QZ_CreateWindowSubdriver(int width, int height, int bpp)
{
CocoaSubdriver *ret;
+#ifdef ENABLE_COCOA_QUARTZ
#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. */
if (MacOSVersionIsAtLeast(10, 5, 0)) {
@@ -239,9 +240,25 @@ static CocoaSubdriver *QZ_CreateWindowSubdriver(int width, int height, int bpp)
if (ret != NULL) return ret;
}
#endif
+#endif
+#ifdef ENABLE_COCOA_QUICKDRAW
ret = QZ_CreateWindowQuickdrawSubdriver(width, height, bpp);
if (ret != NULL) return ret;
+#endif
+
+#ifdef ENABLE_COCOA_QUARTZ
+#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
+ * or it failed to load for some reason. Fall back to Quartz if possible even though that driver is slower.
+ */
+ if (MacOSVersionIsAtLeast(10, 4, 0)) {
+ ret = QZ_CreateWindowQuartzSubdriver(width, height, bpp);
+ if (ret != NULL) return ret;
+ }
+#endif
+#endif
return NULL;
}