Skip to content

Commit

Permalink
Disabled the custom iOS splashscreen code - it interferes with the no…
Browse files Browse the repository at this point in the history
…rmal rotation and orientation behaviour of SDL windows.
  • Loading branch information
slime73 committed Jul 18, 2014
1 parent d2e445d commit e234575
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
10 changes: 8 additions & 2 deletions src/video/uikit/SDL_uikitappdelegate.m
Expand Up @@ -205,12 +205,18 @@ - (void)postFinishLaunch
- (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]];
Expand Down
1 change: 1 addition & 0 deletions src/video/uikit/SDL_uikitviewcontroller.m
Expand Up @@ -127,6 +127,7 @@ - (BOOL)prefersStatusBarHidden
- (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. */
Expand Down
8 changes: 2 additions & 6 deletions src/video/uikit/SDL_uikitwindow.m
Expand Up @@ -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);
Expand Down Expand Up @@ -115,9 +113,7 @@ static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bo
* 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;
Expand Down Expand Up @@ -245,7 +241,7 @@ static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bo
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;
Expand Down

0 comments on commit e234575

Please sign in to comment.