summaryrefslogtreecommitdiff
path: root/src/video/cocoa/cocoa_v.mm
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2020-04-10 14:23:11 +0200
committerMichael Lutz <michi@icosahedron.de>2020-04-12 18:44:43 +0200
commit0e5be3887cd6d77a4f6ab1e8a1b23701de7f12e7 (patch)
treec2e80332b5c45ce186b4be8d9c61dbdaca4ced50 /src/video/cocoa/cocoa_v.mm
parenta31cbbf67fa4137a349d1818efdd5cf81362f79b (diff)
downloadopenttd-0e5be3887cd6d77a4f6ab1e8a1b23701de7f12e7.tar.xz
Remove: [OSX] Old fullscreen subdriver for pre 10.7 systems.
Since the move to C++11, building for pre 10.7 is not possible with the native Apple tools. Also, due to bitrot, the file doesn't even compile anymore. While this could be fixed, it shows that this subdriver is basically never used anymore.
Diffstat (limited to 'src/video/cocoa/cocoa_v.mm')
-rw-r--r--src/video/cocoa/cocoa_v.mm55
1 files changed, 7 insertions, 48 deletions
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm
index 0bda21d25..678fc75be 100644
--- a/src/video/cocoa/cocoa_v.mm
+++ b/src/video/cocoa/cocoa_v.mm
@@ -414,37 +414,18 @@ static CocoaSubdriver *QZ_CreateWindowSubdriver(int width, int height, int bpp)
*/
static CocoaSubdriver *QZ_CreateSubdriver(int width, int height, int bpp, bool fullscreen, bool fallback)
{
- CocoaSubdriver *ret = NULL;
- /* OSX 10.7 allows to toggle fullscreen mode differently */
- if (MacOSVersionIsAtLeast(10, 7, 0)) {
- ret = QZ_CreateWindowSubdriver(width, height, bpp);
- if (ret != NULL && fullscreen) ret->ToggleFullscreen();
- }
-#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9)
- else {
- ret = fullscreen ? QZ_CreateFullscreenSubdriver(width, height, bpp) : QZ_CreateWindowSubdriver(width, height, bpp);
- }
-#endif /* (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9) */
+ CocoaSubdriver *ret = QZ_CreateWindowSubdriver(width, height, bpp);
+ if (ret != nullptr && fullscreen) ret->ToggleFullscreen();
- if (ret != NULL) return ret;
- if (!fallback) return NULL;
+ if (ret != nullptr) return ret;
+ if (!fallback) return nullptr;
/* Try again in 640x480 windowed */
DEBUG(driver, 0, "Setting video mode failed, falling back to 640x480 windowed mode.");
ret = QZ_CreateWindowSubdriver(640, 480, bpp);
- if (ret != NULL) return ret;
-
-#if defined(_DEBUG) && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9)
- /* This Fullscreen mode crashes on OSX 10.7 */
- if (!MacOSVersionIsAtLeast(10, 7, 0)) {
- /* Try fullscreen too when in debug mode */
- DEBUG(driver, 0, "Setting video mode failed, falling back to 640x480 fullscreen mode.");
- ret = QZ_CreateFullscreenSubdriver(640, 480, bpp);
- if (ret != NULL) return ret;
- }
-#endif /* defined(_DEBUG) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) */
+ if (ret != nullptr) return ret;
- return NULL;
+ return nullptr;
}
@@ -555,29 +536,7 @@ bool VideoDriver_Cocoa::ToggleFullscreen(bool full_screen)
{
assert(_cocoa_subdriver != NULL);
- /* For 10.7 and later, we try to toggle using the quartz subdriver. */
- if (_cocoa_subdriver->ToggleFullscreen()) return true;
-
- bool oldfs = _cocoa_subdriver->IsFullscreen();
- if (full_screen != oldfs) {
- int width = _cocoa_subdriver->GetWidth();
- int height = _cocoa_subdriver->GetHeight();
- int bpp = BlitterFactory::GetCurrentBlitter()->GetScreenDepth();
-
- delete _cocoa_subdriver;
- _cocoa_subdriver = NULL;
-
- _cocoa_subdriver = QZ_CreateSubdriver(width, height, bpp, full_screen, false);
- if (_cocoa_subdriver == NULL) {
- _cocoa_subdriver = QZ_CreateSubdriver(width, height, bpp, oldfs, true);
- if (_cocoa_subdriver == NULL) error("Cocoa: Failed to create subdriver");
- }
- }
-
- QZ_GameSizeChanged();
- QZ_UpdateVideoModes();
-
- return _cocoa_subdriver->IsFullscreen() == full_screen;
+ return _cocoa_subdriver->ToggleFullscreen();
}
/**