Reverted Alex's commit 131cba1768a5 - we're about to release 2.0.6, don't remove support for the iOS 7 SDK yet.

This commit is contained in:
Sam Lantinga 2017-09-20 19:59:34 -07:00
parent d452b89f9b
commit f0a324f8eb
4 changed files with 14 additions and 2 deletions

View File

@ -55,6 +55,7 @@ UIKit_WaitUntilMessageBoxClosed(const SDL_MessageBoxData *messageboxdata, int *c
static BOOL static BOOL
UIKit_ShowMessageBoxAlertController(const SDL_MessageBoxData *messageboxdata, int *buttonid) UIKit_ShowMessageBoxAlertController(const SDL_MessageBoxData *messageboxdata, int *buttonid)
{ {
#ifdef __IPHONE_8_0
int i; int i;
int __block clickedindex = messageboxdata->numbuttons; int __block clickedindex = messageboxdata->numbuttons;
const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons; const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons;
@ -110,6 +111,9 @@ UIKit_ShowMessageBoxAlertController(const SDL_MessageBoxData *messageboxdata, in
*buttonid = messageboxdata->buttons[clickedindex].buttonid; *buttonid = messageboxdata->buttons[clickedindex].buttonid;
return YES; return YES;
#else
return NO;
#endif /* __IPHONE_8_0 */
} }
/* UIAlertView is deprecated in iOS 8+ in favor of UIAlertController. */ /* UIAlertView is deprecated in iOS 8+ in favor of UIAlertController. */

View File

@ -92,9 +92,12 @@ UIKit_Mtl_AddMetalView(SDL_Window* window)
* backing dimensions of the Metal view will match the pixel * backing dimensions of the Metal view will match the pixel
* dimensions of the screen rather than the dimensions in points. * dimensions of the screen rather than the dimensions in points.
*/ */
#ifdef __IPHONE_8_0
if ([data.uiwindow.screen respondsToSelector:@selector(nativeScale)]) { if ([data.uiwindow.screen respondsToSelector:@selector(nativeScale)]) {
scale = data.uiwindow.screen.nativeScale; scale = data.uiwindow.screen.nativeScale;
} else { } else
#endif
{
scale = data.uiwindow.screen.scale; scale = data.uiwindow.screen.scale;
} }
} }

View File

@ -211,11 +211,13 @@ UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
availableModes = data.uiscreen.availableModes; availableModes = data.uiscreen.availableModes;
#endif #endif
#ifdef __IPHONE_8_0
/* The UIScreenMode of an iPhone 6 Plus should be 1080x1920 rather than /* The UIScreenMode of an iPhone 6 Plus should be 1080x1920 rather than
* 1242x2208 (414x736@3x), so we should use the native scale. */ * 1242x2208 (414x736@3x), so we should use the native scale. */
if ([data.uiscreen respondsToSelector:@selector(nativeScale)]) { if ([data.uiscreen respondsToSelector:@selector(nativeScale)]) {
scale = data.uiscreen.nativeScale; scale = data.uiscreen.nativeScale;
} }
#endif
for (UIScreenMode *uimode in availableModes) { for (UIScreenMode *uimode in availableModes) {
/* The size of a UIScreenMode is in pixels, but we deal exclusively /* The size of a UIScreenMode is in pixels, but we deal exclusively

View File

@ -168,9 +168,12 @@ UIKit_GL_CreateContext(_THIS, SDL_Window * window)
/* Set the scale to the natural scale factor of the screen - the /* Set the scale to the natural scale factor of the screen - the
* backing dimensions of the OpenGL view will match the pixel * backing dimensions of the OpenGL view will match the pixel
* dimensions of the screen rather than the dimensions in points. */ * dimensions of the screen rather than the dimensions in points. */
#ifdef __IPHONE_8_0
if ([data.uiwindow.screen respondsToSelector:@selector(nativeScale)]) { if ([data.uiwindow.screen respondsToSelector:@selector(nativeScale)]) {
scale = data.uiwindow.screen.nativeScale; scale = data.uiwindow.screen.nativeScale;
} else { } else
#endif
{
scale = data.uiwindow.screen.scale; scale = data.uiwindow.screen.scale;
} }
} }