コード例 #1
0
ファイル: Editor.cpp プロジェクト: gsage/engine
  bool Editor::initialize(const std::string& resourceFolder)
  {
    mResourcePath = resourceFolder;
    if(!FileLoader::getSingletonPtr()->load(GLOBAL_STATE_FILE, DataProxy(), mGlobalEditorState)) {
      if(!FileLoader::getSingletonPtr()->load(DEFAULT_STATE_FILE, DataProxy(), mGlobalEditorState)) {
        LOG(WARNING) << "No saved global state";
      }
    }

    return true;
  }
コード例 #2
0
  bool EditorApplication::loadProject(const QString& projectFilePath)
  {
    DataProxy projectConfig;
    if(!mProjectManager->loadProject(projectFilePath, projectConfig))
    {
      return false;
    }

    QFileInfo projectFileInfo(projectFilePath);
    QString gameConfig(projectConfig.get("configPath", "gameConfig.json").c_str());
    QString resourcePath(projectFileInfo.absolutePath().append(QDir::separator()).append("resources"));
    mConfigOverride.put("render", mConfig.get<DataProxy>("render", DataProxy()));

    initEngine("renderWindow", gameConfig, resourcePath);
    return true;
  }