Changeset 7993 for code/branches/usability
- Timestamp:
- Feb 27, 2011, 6:26:37 PM (14 years ago)
- Location:
- code/branches/usability/src/libraries/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/src/libraries/core/Game.cc
r7284 r7993 50 50 #include "GameMode.h" 51 51 #include "GameState.h" 52 #include "GraphicsManager.h" 52 53 #include "GUIManager.h" 53 54 #include "command/ConsoleCommand.h" … … 142 143 SetConfigValue(statisticsAvgLength_, 1000000) 143 144 .description("Sets the time in microseconds interval at which average fps, etc. gets calculated."); 144 SetConfigValue(fpsLimit_, 50) 145 146 SetConfigValueExternal(fpsLimit_, "GraphicsSettings", "fpsLimit", 50) 145 147 .description("Sets the desired frame rate (0 for no limit)."); 146 148 } … … 207 209 208 210 // Limit frame rate 209 this->updateFPSLimiter(); 211 static bool hasVSync = GraphicsManager::getInstance().hasVSyncEnabled(); // can be static since changes of VSync currently require a restart 212 if (this->fpsLimit_ > 0 && !hasVSync) 213 this->updateFPSLimiter(); 210 214 } 211 215 -
code/branches/usability/src/libraries/core/GraphicsManager.cc
r7992 r7993 318 318 CCOUT(4) << "Configuring Renderer" << std::endl; 319 319 320 if (!ogreRoot_->restoreConfig() || Core::getInstance().getOgreConfigTimestamp() > Core::getInstance().getLastLevelTimestamp()) 320 bool updatedConfig = Core::getInstance().getOgreConfigTimestamp() > Core::getInstance().getLastLevelTimestamp(); 321 if (updatedConfig) 322 COUT(2) << "Ogre config file has changed, but no level was started since then. Displaying config dialogue again to verify the changes." << std::endl; 323 324 if (!ogreRoot_->restoreConfig() || updatedConfig) 321 325 { 322 326 if (!ogreRoot_->showConfigDialog()) … … 466 470 } 467 471 472 bool GraphicsManager::hasVSyncEnabled() const 473 { 474 Ogre::ConfigOptionMap& options = ogreRoot_->getRenderSystem()->getConfigOptions(); 475 if (options.find("VSync") != options.end()) 476 return (options["VSync"].currentValue == "Yes"); 477 else 478 return false; 479 } 480 468 481 std::string GraphicsManager::setScreenResolution(unsigned int width, unsigned int height, bool fullscreen) 469 482 { -
code/branches/usability/src/libraries/core/GraphicsManager.h
r7989 r7993 75 75 size_t getRenderWindowHandle(); 76 76 bool isFullScreen() const; 77 bool hasVSyncEnabled() const; 77 78 78 79 void upgradeToGraphics();
Note: See TracChangeset
for help on using the changeset viewer.