Skip to content

Commit e12e4af

Browse files
committed
Named CC_MINIMUM_TABLET_SCREEN_DIAGONAL
1 parent 8e8a648 commit e12e4af

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

cocos2d/CCConfiguration.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
#import "Platforms/CCGL.h"
3030

31+
#define CC_MINIMUM_TABLET_SCREEN_DIAGONAL 6.0
32+
3133
extern NSString* const CCSetupPixelFormat;
3234
extern NSString* const CCSetupScreenMode;
3335
extern NSString* const CCSetupScreenOrientation;

cocos2d/CCConfiguration.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,14 @@ -(NSInteger) runningDevice
146146
NSInteger ret=-1;
147147

148148
#if __CC_PLATFORM_ANDROID
149-
150149

151150
AndroidDisplayMetrics *metrics = [[AndroidDisplayMetrics alloc] init];
152151
[[CCActivity currentActivity].windowManager.defaultDisplay getMetrics:metrics];
153152
double yInches= metrics.heightPixels/metrics.ydpi;
154153
double xInches= metrics.widthPixels/metrics.xdpi;
155154
double diagonalInches = sqrt(xInches*xInches + yInches*yInches);
156-
if (diagonalInches<=6){
157-
155+
if (diagonalInches<=CC_MINIMUM_TABLET_SCREEN_DIAGONAL){
156+
158157

159158
if([CCDirector sharedDirector].contentScaleFactor > 1.0)
160159
{
@@ -173,7 +172,7 @@ -(NSInteger) runningDevice
173172
{
174173
ret = CCDeviceiPad;
175174
}
176-
175+
177176
}
178177
#elif __CC_PLATFORM_IOS
179178

0 commit comments

Comments
 (0)