Skip to content

Commit

Permalink
Fix compile issue with ios < 8 inside cocos2d lib
Browse files Browse the repository at this point in the history
  • Loading branch information
vladubogdan committed Jan 24, 2015
1 parent b1c9c98 commit e2cdcd5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion LH_COCOS2D_PROJECT_TEMPLATE.plist
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>Version</key>
<integer>17</integer>
<integer>18</integer>
<key>NewProjectQuestion</key>
<string>Do you want to use the basic Cocos2d Xcode project template?</string>
<key>NewProjectInfo</key>
Expand Down
Binary file not shown.
17 changes: 12 additions & 5 deletions cocos2d/cocos2d/Platforms/iOS/CCGLView.m
Expand Up @@ -221,11 +221,18 @@ - (id) initWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GL

// Default to the screen's native scale.
UIScreen *screen = [UIScreen mainScreen];
if([screen respondsToSelector:@selector(nativeScale)]){
self.contentScaleFactor = screen.nativeScale;
} else {
self.contentScaleFactor = screen.scale;
}

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0
self.contentScaleFactor = screen.nativeScale;
#else
self.contentScaleFactor = screen.scale;
#endif

// if([screen respondsToSelector:@selector(nativeScale)]){
// self.contentScaleFactor = screen.nativeScale;
// } else {
// self.contentScaleFactor = screen.scale;
// }

if( ! [self setupSurfaceWithSharegroup:sharegroup] ) {
return nil;
Expand Down

0 comments on commit e2cdcd5

Please sign in to comment.