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
commit2885c660603b09547dfa95bd1fd10e5b8696a05b (patch)
treefdea3d4a12c2e7ff0a33ec90ed275295f25ace28 /src/video/cocoa/cocoa_v.mm
parent93c3e0d6ada1761431bb39060bbc3a7ab95803f1 (diff)
downloadopenttd-2885c660603b09547dfa95bd1fd10e5b8696a05b.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;
}