当前位置: 首页>>代码示例>>C++>>正文


C++ FileUtils::setSearchPaths方法代码示例

本文整理汇总了C++中FileUtils::setSearchPaths方法的典型用法代码示例。如果您正苦于以下问题:C++ FileUtils::setSearchPaths方法的具体用法?C++ FileUtils::setSearchPaths怎么用?C++ FileUtils::setSearchPaths使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileUtils的用法示例。


在下文中一共展示了FileUtils::setSearchPaths方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: onExit

void TestSearchPath::onExit()
{
    FileUtils *sharedFileUtils = FileUtils::getInstance();

    // reset search path
    sharedFileUtils->setSearchPaths(_defaultSearchPathArray);
    sharedFileUtils->setSearchResolutionsOrder(_defaultResolutionsOrderArray);
    FileUtilsDemo::onExit();
}
开发者ID:anilgulgor,项目名称:myGame,代码行数:9,代码来源:FileUtilsTest.cpp

示例2: setResourceRootPath

void Application::setResourceRootPath(const std::string& rootResDir)
{
    _resourceRootPath = rootResDir;
    if (_resourceRootPath[_resourceRootPath.length() - 1] != '/')
    {
        _resourceRootPath += '/';
    }
    FileUtils* pFileUtils = FileUtils::getInstance();
    std::vector<std::string> searchPaths = pFileUtils->getSearchPaths();
    searchPaths.insert(searchPaths.begin(), _resourceRootPath);
    pFileUtils->setSearchPaths(searchPaths);
}
开发者ID:BeemoLin,项目名称:daca,代码行数:12,代码来源:CCApplication-linux.cpp

示例3: initResourcePath

void AppDelegate::initResourcePath()
{
    FileUtils* sharedFileUtils = FileUtils::getInstance();
    //设置SearchPaths
    std::vector<std::string> oldSearchPaths = sharedFileUtils->getSearchPaths();
    std::vector<std::string> tempPaths(oldSearchPaths);
    std::vector<std::string> searchPaths;
    searchPaths.push_back(sharedFileUtils->getWritablePath() + "upd/");
    searchPaths.push_back("res/");
    searchPaths.push_back("src/");
    
    for (int i = 0; i < tempPaths.size(); ++i) {
        searchPaths.push_back(tempPaths[i]);
    }
    
    sharedFileUtils->setSearchPaths(searchPaths);
    
//    MyUnZip::getInstance()->UnZipFile("/Users/binW/Downloads/game.zip", "/Users/binW/Downloads/", PrintfText);
}
开发者ID:miyccc,项目名称:quickupdate,代码行数:19,代码来源:AppDelegate.cpp

示例4: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{

    //#if (COCOS2D_DEBUG>0)
    //    initRuntime();
    //#endif

    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        Size viewSize = ConfigParser::getInstance()->getInitViewSize();
        std::string title = "VeewoGames";
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
        extern void createSimulator(const char* viewName, float width, float height,bool isLandscape = true, float frameZoomFactor = 1.0f);
        bool isLanscape = ConfigParser::getInstance()->isLanscape();
        createSimulator(title.c_str(),viewSize.width,viewSize.height,isLanscape);
#else
        glview = cocos2d::GLViewImpl::createWithRect(title.c_str(), Rect(0,0,viewSize.width,viewSize.height));
        log(">>>>>>> enter the config");
        director->setOpenGLView(glview);
#endif
    }
    log(">>>>>>> enter the hehehehe");
    cocosbuilder::CCBReader::setResolutionScale(1);

    FileUtils* fileutils = FileUtils::getInstance();

    VeeResUpdate::getInstance()->checkLocalUpdate();

    std::vector<std::string> paths = fileutils->getSearchPaths();
    paths.insert(paths.begin(), "res");
    paths.insert(paths.begin(), fileutils->getWritablePath());
    paths.insert(paths.begin(), fileutils->getWritablePath() + "update/");
    fileutils->setSearchPaths(paths);

//    fileutils->cacheFile("xxx.ccbi", true);

    director->setAnimationInterval(1.0 / 60);

    ScriptingCore* sc = ScriptingCore::getInstance();
    sc->addRegisterCallback(register_all_cocos2dx);
    sc->addRegisterCallback(register_all_cocos2dx_extension);
    sc->addRegisterCallback(register_cocos2dx_js_extensions);
    sc->addRegisterCallback(register_all_cocos2dx_extension_manual);
    //    sc->addRegisterCallback(jsb_register_chipmunk);
    sc->addRegisterCallback(jsb_register_system);
    sc->addRegisterCallback(JSB_register_opengl);

    sc->addRegisterCallback(register_all_cocos2dx_builder);
    sc->addRegisterCallback(register_CCBuilderReader);
    sc->addRegisterCallback(register_all_pluginx_protocols);

    sc->addRegisterCallback(register_pluginx_js_extensions);
    //    sc->addRegisterCallback(register_all_cocos2dx_ui);
    //    sc->addRegisterCallback(register_all_cocos2dx_ui_manual);
    //    sc->addRegisterCallback(register_all_cocos2dx_studio);
    //    sc->addRegisterCallback(register_all_cocos2dx_studio_manual);
    //
    //    sc->addRegisterCallback(register_all_cocos2dx_spine);
    //    sc->addRegisterCallback(register_all_cocos2dx_spine_manual);

    sc->addRegisterCallback(MinXmlHttpRequest::_js_register);
    sc->addRegisterCallback(register_jsb_websocket);
    sc->addRegisterCallback(register_jsb_socketio);

#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
    sc->addRegisterCallback(JavascriptJavaBridge::_js_register);
#endif

    sc->addRegisterCallback(register_all_veewo_extension);

    //#if (COCOS2D_DEBUG>0)
    //    if (startRuntime())
    //        return true;
    //#endif

    ScriptingCore::getInstance()->start();
    auto engine = ScriptingCore::getInstance();
    ScriptEngineManager::getInstance()->setScriptEngine(engine);
    ScriptingCore::getInstance()->runScript(ConfigParser::getInstance()->getEntryFile().c_str());

    VeeResUpdate::getInstance()->checkUpdate();

    return true;
}
开发者ID:Tezika,项目名称:TankDemo,代码行数:86,代码来源:AppDelegate.cpp


注:本文中的FileUtils::setSearchPaths方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。