From a4760698ca5493d464795ca59aef6f88cca33101 Mon Sep 17 00:00:00 2001 From: Nat Weiss Date: Sat, 21 Jul 2012 11:35:28 -0700 Subject: [PATCH] Determines whether to use iPad graphics statically, so if the window is resized the graphics loaded are consistent. --- cocos2dx/platform/mac/CCFileUtils.mm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cocos2dx/platform/mac/CCFileUtils.mm b/cocos2dx/platform/mac/CCFileUtils.mm index 534d0a0f03..25ea5d7230 100755 --- a/cocos2dx/platform/mac/CCFileUtils.mm +++ b/cocos2dx/platform/mac/CCFileUtils.mm @@ -54,8 +54,16 @@ CCArray* ccFileUtils_arrayWithContentsOfFileThreadSafe(const char* pFileName); static bool isIPad() { - CCSize winSize = CCDirector::sharedDirector()->getWinSize(); - return (winSize.width >= 1024 && winSize.height >= 768); + // 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(); + isIPad = (winSize.width >= 1024 && winSize.height >= 768); + isSet = true; + } + return isIPad; } static NSString* removeSuffixFromPath(NSString *suffix, NSString *path)