setSearchPaths makes no sense.

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)

I would like to leave a reply that I’ve solved the problem -
the problem was that i wasn’t copying the folder structures when I was importing the resources into the project.

which version are you using? 2.1.3 is fine.

Il Jae Lee wrote:

I would like to leave a reply that I’ve solved the problem -
the problem was that i wasn’t copying the folder structures when I was importing the resources into the project.