src/video/cocoa/cocoa_v.mm
changeset 8092 233af5e53af9
parent 8039 fa18f4352154
child 8127 a20f557b7081
--- a/src/video/cocoa/cocoa_v.mm	Mon Dec 17 01:35:45 2007 +0000
+++ b/src/video/cocoa/cocoa_v.mm	Mon Dec 17 07:47:21 2007 +0000
@@ -232,6 +232,7 @@
 {
 	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 @@
 		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;
 }