Skip to content

Commit

Permalink
[ios] - fix retina support for iPad3 when not building with xcode4 an…
Browse files Browse the repository at this point in the history
…d current ios sdk 5.1
  • Loading branch information
Memphiz committed Jun 4, 2012
1 parent e82bffa commit 1c5f6ab
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
10 changes: 10 additions & 0 deletions xbmc/osx/ios/XBMCController.mm
Expand Up @@ -37,6 +37,7 @@
#include "utils/TimeUtils.h"
#include "Util.h"
#include "WinEventsIOS.h"
#include "osx/DarwinUtils.h"
#undef BOOL

#import "XBMCEAGLView.h"
Expand Down Expand Up @@ -345,7 +346,16 @@ - (id)initWithFrame:(CGRect)frame

/* Check if screen is Retina */
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
{
screenScale = [[UIScreen mainScreen] scale];
//if no retina display scale detected yet -
//ensure retina resolution on ipad3
//even on older iOS SDKs
if (screenScale == 1.0 && DarwinIsIPad3())
{
screenScale = 2.0;
}
}
else
screenScale = 1.0;

Expand Down
13 changes: 11 additions & 2 deletions xbmc/osx/ios/XBMCEAGLView.mm
Expand Up @@ -34,6 +34,7 @@
#include "utils/log.h"
#include "utils/TimeUtils.h"
#include "Util.h"
#include "osx/DarwinUtils.h"
#undef BOOL

#import <QuartzCore/QuartzCore.h>
Expand Down Expand Up @@ -74,8 +75,16 @@ - (id)initWithFrame:(CGRect)frame

if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
{
eaglLayer.contentsScale = [[UIScreen mainScreen] scale];
self.contentScaleFactor = [[UIScreen mainScreen] scale];
CGFloat scale = [[UIScreen mainScreen] scale];
//if no retina display scale detected yet -
//ensure retina resolution on ipad3
//even on older iOS SDKs
if (scale == 1.0 && DarwinIsIPad3())
{
scale = 2.0;
}
eaglLayer.contentsScale = scale;
self.contentScaleFactor = scale;
}
eaglLayer.opaque = TRUE;
eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
Expand Down

0 comments on commit 1c5f6ab

Please sign in to comment.