Support iPhone 5 launch images
authorSam Lantinga <slouken@libsdl.org>
Thu, 04 Oct 2012 02:56:25 -0700
changeset 655787ba88e3f2a9
parent 6556 d5e854f0d9a9
child 6558 90f231aa77b9
Support iPhone 5 launch images
src/video/uikit/SDL_uikitappdelegate.m
     1.1 --- a/src/video/uikit/SDL_uikitappdelegate.m	Thu Oct 04 02:13:12 2012 -0700
     1.2 +++ b/src/video/uikit/SDL_uikitappdelegate.m	Thu Oct 04 02:56:25 2012 -0700
     1.3 @@ -99,10 +99,14 @@
     1.4      self->splash = [[UIImageView alloc] init];
     1.5      [self setView:self->splash];
     1.6  
     1.7 -    self->splashPortrait = [UIImage imageNamed:@"Default.png"];
     1.8 +    CGSize size = [UIScreen mainScreen].bounds.size;
     1.9 +    float height = SDL_max(size.width, size.height);
    1.10 +    self->splashPortrait = [UIImage imageNamed:[NSString stringWithFormat:@"Default-%dh.png", (int)height]];
    1.11 +    if (!self->splashPortrait) {
    1.12 +        self->splashPortrait = [UIImage imageNamed:@"Default.png"];
    1.13 +    }
    1.14      self->splashLandscape = [UIImage imageNamed:@"Default-Landscape.png"];
    1.15 -    if (!self->splashLandscape && self->splashPortrait)
    1.16 -    {
    1.17 +    if (!self->splashLandscape && self->splashPortrait) {
    1.18          self->splashLandscape = [[UIImage alloc] initWithCGImage: self->splashPortrait.CGImage
    1.19                                                             scale: 1.0
    1.20                                                       orientation: UIImageOrientationRight];