mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-30 11:17:08 -05:00
662a9e99f5
- remove cocos2dx folder - change all include paths in cocos2d to be relative
29 lines
618 B
Text
Vendored
29 lines
618 B
Text
Vendored
#include "CCDevice.h"
|
|
#import <UIKit/UIKit.h>
|
|
|
|
NS_CC_BEGIN
|
|
|
|
int CCDevice::getDPI()
|
|
{
|
|
static int dpi = -1;
|
|
|
|
if (dpi == -1)
|
|
{
|
|
float scale = 1.0f;
|
|
|
|
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
|
|
scale = [[UIScreen mainScreen] scale];
|
|
}
|
|
|
|
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
|
dpi = 132 * scale;
|
|
} else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
|
|
dpi = 163 * scale;
|
|
} else {
|
|
dpi = 160 * scale;
|
|
}
|
|
}
|
|
return dpi;
|
|
}
|
|
|
|
NS_CC_END
|