Determines whether to use iPad graphics statically, so if the window is resized the graphics loaded are consistent.

This commit is contained in:
Nat Weiss 2012-07-21 11:35:28 -07:00
parent dc7ce1cd0f
commit a4760698ca
1 changed files with 10 additions and 2 deletions

View File

@ -54,8 +54,16 @@ CCArray* ccFileUtils_arrayWithContentsOfFileThreadSafe(const char* pFileName);
static bool isIPad()
{
// save whether to load iPad resources so if the window is resized, we are consistent
static bool isSet = false;
static bool isIPad = false;
if( !isSet )
{
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
return (winSize.width >= 1024 && winSize.height >= 768);
isIPad = (winSize.width >= 1024 && winSize.height >= 768);
isSet = true;
}
return isIPad;
}
static NSString* removeSuffixFromPath(NSString *suffix, NSString *path)