[SOLVED] How to set the right sprites folder since cocos2d-2.1beta3-x-2.1.1

Hi, is this the right way to select the sprites folder (sd, hd and ipadhd) with the new cocos2d-x version cocos2d-2.1beta3-x-2.1.1 as we can see here:
[http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Mechanism_of_loading_resources]

The problem is that the right folder is selected once on two tries. Once on two tries the hd folder is selected instead of the sd folder :

That’s the code i use in AppDelegate.cpp bool AppDelegate::applicationDidFinishLaunching()

    CCSize designSize = CCSizeMake(480, 320);
    CCSize resourceSize = CCSizeMake(480, 320);
    CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize();

    std::vector searchPaths;
    std::vector resDirOrders;

        searchPaths.push_back("Images"); // Resources/Images
        CCFileUtils::sharedFileUtils()->setSearchPaths(searchPaths);

        if (screenSize.height > 768)
        {
            resourceSize = CCSizeMake(2048, 1536);
            resDirOrders.push_back("ipadhd");
            cout<<"ipadhd";
        }
        else if (screenSize.height > 640)
        {
            resourceSize = CCSizeMake(1536, 768);
            resDirOrders.push_back("hd");
            cout<<"hd";
        }
        else if (screenSize.height > 480)
        {
            resourceSize = CCSizeMake(960, 640);
            resDirOrders.push_back("hd");
            cout<<"hd";
        }
        else
        {
            resDirOrders.push_back("sd");
            cout<<"sd";
        }

    CCFileUtils::sharedFileUtils()->setSearchResolutionsOrder(resDirOrders);

    pDirector->setContentScaleFactor(resourceSize.width/designSize.width);

    CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionShowAll);

Any idea? Thanks:)

It looks like your resource folders are not added as references.
In xCode editor the folders should be blue if added correctly.

That was it! Now it works! Thank you :slight_smile: