bool OgreSubsystem::Configure() { // Show the configuration dialog and initialise the system // You can skip this and use root.restoreConfig() to load configuration // settings if you were sure there are valid ones saved in ogre.cfg bool use_ogre_config = BSETTING("USE_OGRE_CONFIG", false); bool ok = false; if (use_ogre_config) { ok = m_ogre_root->showConfigDialog(); } else { ok = m_ogre_root->restoreConfig(); } if (ok) { // If returned true, user clicked OK so initialise // Here we choose to let the system create a default rendering window by passing 'true' m_render_window = m_ogre_root->initialise(true, "Rigs of Rods version " + Ogre::String(ROR_VERSION_STRING)); // set window icon correctly fixRenderWindowIcon(m_render_window); return true; } else { ErrorUtils::ShowError(_L("Configuration error"), _L("Run the RoRconfig program first.")); exit(1); } return true; }
void LoadingWindow::setAutotrack(const Ogre::UTFString& _text, bool _updateRenderFrame) { if(BSETTING("REPO_MODE")) return; mMainWidget->setVisible(true); mInfoStaticText->setCaption(convertToMyGUIString(_text)); mBarProgress->setProgressPosition(0); mBarProgress->setProgressAutoTrack(true); if( _updateRenderFrame ) renderOneFrame(); }
void LoadingWindow::renderOneFrame(bool force) { if(BSETTING("REPO_MODE")) return; if(t->getMilliseconds() > 200 || force) { mFrameForced=true; // we must pump the window messages, otherwise the window will get white on Vista ... RoRWindowEventUtilities::messagePump(); Ogre::Root::getSingleton().renderOneFrame(); t->reset(); } }
void LoadingWindow::hide() { if(BSETTING("REPO_MODE")) return; GUIManager::getSingleton().unfocus(); mMainWidget->setVisible(false); }