230 |
230 |
231 static CocoaSubdriver *QZ_CreateWindowSubdriver(int width, int height, int bpp) |
231 static CocoaSubdriver *QZ_CreateWindowSubdriver(int width, int height, int bpp) |
232 { |
232 { |
233 CocoaSubdriver *ret; |
233 CocoaSubdriver *ret; |
234 |
234 |
|
235 #ifdef ENABLE_COCOA_QUARTZ |
235 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 |
236 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 |
236 /* The reason for the version mismatch is due to the fact that the 10.4 binary needs to work on 10.5 as well. */ |
237 /* The reason for the version mismatch is due to the fact that the 10.4 binary needs to work on 10.5 as well. */ |
237 if (MacOSVersionIsAtLeast(10, 5, 0)) { |
238 if (MacOSVersionIsAtLeast(10, 5, 0)) { |
238 ret = QZ_CreateWindowQuartzSubdriver(width, height, bpp); |
239 ret = QZ_CreateWindowQuartzSubdriver(width, height, bpp); |
239 if (ret != NULL) return ret; |
240 if (ret != NULL) return ret; |
240 } |
241 } |
241 #endif |
242 #endif |
242 |
243 #endif |
|
244 |
|
245 #ifdef ENABLE_COCOA_QUICKDRAW |
243 ret = QZ_CreateWindowQuickdrawSubdriver(width, height, bpp); |
246 ret = QZ_CreateWindowQuickdrawSubdriver(width, height, bpp); |
244 if (ret != NULL) return ret; |
247 if (ret != NULL) return ret; |
|
248 #endif |
|
249 |
|
250 #ifdef ENABLE_COCOA_QUARTZ |
|
251 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 |
|
252 /* |
|
253 * If we get here we are running 10.4 or earlier and either openttd was compiled without the quickdraw driver |
|
254 * or it failed to load for some reason. Fall back to Quartz if possible even though that driver is slower. |
|
255 */ |
|
256 if (MacOSVersionIsAtLeast(10, 4, 0)) { |
|
257 ret = QZ_CreateWindowQuartzSubdriver(width, height, bpp); |
|
258 if (ret != NULL) return ret; |
|
259 } |
|
260 #endif |
|
261 #endif |
245 |
262 |
246 return NULL; |
263 return NULL; |
247 } |
264 } |
248 |
265 |
249 |
266 |