Disabled the custom iOS splashscreen code - it interferes with the normal rotation and orientation behaviour of SDL windows. iOS-improvements
authorAlex Szpakowski <slime73@gmail.com>
Thu, 17 Jul 2014 22:55:59 -0300
branchiOS-improvements
changeset 9495 76e878c8ca80
parent 9494 435b95e7b712
child 9496 abc8df8ce987
Disabled the custom iOS splashscreen code - it interferes with the normal rotation and orientation behaviour of SDL windows.
src/video/uikit/SDL_uikitappdelegate.m
src/video/uikit/SDL_uikitviewcontroller.m
src/video/uikit/SDL_uikitwindow.m
--- a/src/video/uikit/SDL_uikitappdelegate.m	Thu Jul 17 18:05:12 2014 -0300
+++ b/src/video/uikit/SDL_uikitappdelegate.m	Thu Jul 17 22:55:59 2014 -0300
@@ -205,12 +205,18 @@
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
 {
     /* Keep the launch image up until we set a video mode */
-    launch_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+
+    /* This is disabled temporarily because the splash viewcontroller is
+     * interfering with rotation once a regular window is created: the view's
+     * orientations are incorrect and the status bar rotates without the view.
+     * Additionally, the splash viewcontroller doesn't load the correct launch
+     * images on iOS 7 and modern devices. */
+    /*launch_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
 
     UIViewController *splashViewController = [[SDL_splashviewcontroller alloc] init];
     launch_window.rootViewController = splashViewController;
     [launch_window addSubview:splashViewController.view];
-    [launch_window makeKeyAndVisible];
+    [launch_window makeKeyAndVisible];*/
 
     /* Set working directory to resource path */
     [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]];
--- a/src/video/uikit/SDL_uikitviewcontroller.m	Thu Jul 17 18:05:12 2014 -0300
+++ b/src/video/uikit/SDL_uikitviewcontroller.m	Thu Jul 17 22:55:59 2014 -0300
@@ -127,6 +127,7 @@
 - (UIStatusBarStyle)preferredStatusBarStyle
 {
 #ifdef __IPHONE_7_0
+    /* We assume most games don't have a bright white background. */
     return UIStatusBarStyleLightContent;
 #else
     /* This method is only used in iOS 7+, so the return value here isn't important. */
--- a/src/video/uikit/SDL_uikitwindow.m	Thu Jul 17 18:05:12 2014 -0300
+++ b/src/video/uikit/SDL_uikitwindow.m	Thu Jul 17 22:55:59 2014 -0300
@@ -42,8 +42,6 @@
 #include <Foundation/Foundation.h>
 
 
-
-
 static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bool created)
 {
     SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
@@ -115,9 +113,7 @@
      * device orientation changes. This will trigger resize events, if
      * appropriate.
      */
-    SDL_uikitviewcontroller *controller;
-    controller = [SDL_uikitviewcontroller alloc];
-    data->viewcontroller = [controller initWithSDLWindow:window];
+    data->viewcontroller = [[SDL_uikitviewcontroller alloc] initWithSDLWindow:window];
     [data->viewcontroller setTitle:@"SDL App"];  /* !!! FIXME: hook up SDL_SetWindowTitle() */
 
     return 0;
@@ -245,7 +241,7 @@
     SDL_uikitviewcontroller *viewcontroller = windowdata->viewcontroller;
     UIWindow *uiwindow = windowdata->uiwindow;
 
-    if (fullscreen) {
+    if (fullscreen || (window->flags & SDL_WINDOW_BORDERLESS)) {
         [UIApplication sharedApplication].statusBarHidden = YES;
     } else {
         [UIApplication sharedApplication].statusBarHidden = NO;