mirror of https://github.com/encounter/SDL.git
Fixed the extended launch screen causing minor visual issues when rotating the screen in some circumstances.
This commit is contained in:
parent
ea5d1a8a3f
commit
3e17fbee7e
|
@ -25,7 +25,6 @@
|
||||||
|
|
||||||
- (instancetype)init;
|
- (instancetype)init;
|
||||||
- (void)loadView;
|
- (void)loadView;
|
||||||
- (BOOL)shouldAutorotate;
|
|
||||||
- (NSUInteger)supportedInterfaceOrientations;
|
- (NSUInteger)supportedInterfaceOrientations;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -115,7 +115,9 @@ SDL_LoadLaunchImageNamed(NSString *name, int screenh)
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation SDLLaunchScreenController
|
@implementation SDLLaunchScreenController {
|
||||||
|
UIInterfaceOrientationMask supportedOrientations;
|
||||||
|
}
|
||||||
|
|
||||||
- (instancetype)init
|
- (instancetype)init
|
||||||
{
|
{
|
||||||
|
@ -126,6 +128,9 @@ SDL_LoadLaunchImageNamed(NSString *name, int screenh)
|
||||||
NSBundle *bundle = [NSBundle mainBundle];
|
NSBundle *bundle = [NSBundle mainBundle];
|
||||||
NSString *screenname = [bundle objectForInfoDictionaryKey:@"UILaunchStoryboardName"];
|
NSString *screenname = [bundle objectForInfoDictionaryKey:@"UILaunchStoryboardName"];
|
||||||
|
|
||||||
|
/* Normally we don't want to rotate from the initial orientation. */
|
||||||
|
supportedOrientations = (1 << [UIApplication sharedApplication].statusBarOrientation);
|
||||||
|
|
||||||
/* Launch screens were added in iOS 8. Otherwise we use launch images. */
|
/* Launch screens were added in iOS 8. Otherwise we use launch images. */
|
||||||
if (screenname && UIKit_IsSystemVersionAtLeast(8.0)) {
|
if (screenname && UIKit_IsSystemVersionAtLeast(8.0)) {
|
||||||
@try {
|
@try {
|
||||||
|
@ -211,6 +216,12 @@ SDL_LoadLaunchImageNamed(NSString *name, int screenh)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image) {
|
if (image) {
|
||||||
|
if (image.size.width > image.size.height) {
|
||||||
|
supportedOrientations = UIInterfaceOrientationMaskLandscape;
|
||||||
|
} else {
|
||||||
|
supportedOrientations = UIInterfaceOrientationMaskPortrait;
|
||||||
|
}
|
||||||
|
|
||||||
self.view = [[UIImageView alloc] initWithImage:image];
|
self.view = [[UIImageView alloc] initWithImage:image];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,14 +234,9 @@ SDL_LoadLaunchImageNamed(NSString *name, int screenh)
|
||||||
/* Do nothing. */
|
/* Do nothing. */
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)shouldAutorotate
|
|
||||||
{
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSUInteger)supportedInterfaceOrientations
|
- (NSUInteger)supportedInterfaceOrientations
|
||||||
{
|
{
|
||||||
return UIInterfaceOrientationMaskAll;
|
return supportedOrientations;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in New Issue