Changeset 1120
- Timestamp:
- Apr 21, 2008, 6:59:07 PM (17 years ago)
- Location:
- code/trunk/src
- Files:
-
- 2 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/Orxonox.cc
r1092 r1120 54 54 //#include "util/Sleep.h" 55 55 #include "util/ArgReader.h" 56 #include "util/ExprParser.h" 56 57 57 58 // core … … 123 124 InputBuffer* ib_; 124 125 }; 126 127 class Calculator 128 { 129 public: 130 static void calculate(const std::string& calculation) 131 { 132 ExprParser expr(calculation); 133 if (expr.getSuccess()) 134 { 135 if (expr.getResult() == 42.0) 136 std::cout << "Greetings from the restaurant at the end of the universe." << std::endl; 137 // FIXME: insert modifier to display in full precision 138 std::cout << "Result is: " << expr.getResult() << std::endl; 139 if (expr.getRemains() != "") 140 std::cout << "Warning: Expression could not be parsed to the end! Remains: '" 141 << expr.getRemains() << "'" << std::endl; 142 } 143 else 144 std::cout << "Cannot calculate expression: Parse error" << std::endl; 145 } 146 }; 147 ConsoleCommandShortcut(Calculator, calculate, AccessLevel::None); 125 148 126 149 /** … … 410 433 return; 411 434 } 435 Ogre::Root& ogreRoot = Ogre::Root::getSingleton(); 436 412 437 413 438 // Contains the times of recently fired events … … 429 454 { 430 455 // Pump messages in all registered RenderWindows 456 // This calls the WindowEventListener objects. 431 457 Ogre::WindowEventUtilities::messagePump(); 432 458 … … 452 478 // don't forget to call _fireFrameStarted in ogre to make sure 453 479 // everything goes smoothly 454 Ogre::Root::getSingleton()._fireFrameStarted(evt);480 ogreRoot._fireFrameStarted(evt); 455 481 456 482 // server still renders at the moment 457 483 //if (mode_ != SERVER) 458 Ogre::Root::getSingleton()._updateAllRenderTargets(); // only render in non-server mode484 ogreRoot._updateAllRenderTargets(); // only render in non-server mode 459 485 460 486 // get current time … … 466 492 467 493 // again, just to be sure ogre works fine 468 Ogre::Root::getSingleton()._fireFrameEnded(evt);494 ogreRoot._fireFrameEnded(evt); 469 495 } 470 496 } -
code/trunk/src/util/CMakeLists.txt
r1115 r1120 7 7 Clipboard.cc 8 8 SubString.cc 9 ExprParser.cc 9 10 MultiTypePrimitive.cc 10 11 MultiTypeString.cc
Note: See TracChangeset
for help on using the changeset viewer.