Hi all, I’ve been developing with the Cocos2D-x platform… and this is what I see in code.
CCFileUtils::sharedFileUtils()->purgeCachedEntries();
std::vector searchPaths = CCFileUtils::sharedFileUtils()->getSearchPaths();
if(CCApplication::sharedApplication()->getTargetPlatform() == kTargetIpad)
{
if(screenSize.width != 768)
{
//iPad 3+
g_screenScale = 4.f;
searchPaths.insert(searchPaths.begin(),"iPad_R");
}
else
{
//iPad 1~2
g_screenScale = 2.f;
searchPaths.insert(searchPaths.begin(),"iPad");
}
}
else
{
if(screenSize.width != 320)
{
g_screenScale = 2.f;
searchPaths.insert(searchPaths.begin(),"iPhone_R");
}
else
{
//iPhone 4+
g_screenScale = 1.f;
searchPaths.insert(searchPaths.begin(),"iPhone");
}
}
CCFileUtils::sharedFileUtils()->setSearchPaths(searchPaths);
And when I try to load the appropriate images, this is what I see.
The sprites seems to be loaded from completely random location (from one of the search paths I’ve provided.)
Can anyone tell me what’s wrong?
This really frustrates me.
Using Cocos2D-x 2.1.3
스크린샷 2013-07-09 오후 11.19.12.png (52.4 KB)