Changeset 1211 for code/branches/camera/src/orxonox
- Timestamp:
- May 1, 2008, 6:09:05 PM (17 years ago)
- Location:
- code/branches/camera/src/orxonox
- Files:
-
- 2 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/camera/src/orxonox/CMakeLists.txt
r1201 r1211 31 31 # objects/weapon/BulletManager.cc 32 32 # objects/weapon/WeaponStation.cc 33 tolua/tolua_bind.cc 34 # tolua/tolua_bind.h 33 35 ) 34 36 37 #SET_SOURCE_FILES_PROPERTIES(tolua/tolua_bind.h 38 # PROPERTIES 39 # OBJECT_DEPENDS tolua/tolua_bind.h 40 # OBJECT_DEPENDS tolua/tolua_bind.cc 41 # GENERATED true 42 # HEADER_FILE_ONLY true 43 #) 44 45 GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION) 46 ADD_CUSTOM_COMMAND( 47 OUTPUT tolua/tolua_bind.cc tolua/tolua_bind.h 48 COMMAND ${TOLUA_EXE} -n orxonox -o ../../src/orxonox/tolua/tolua_bind.cc -H ../../src/orxonox/tolua/tolua_bind.h ../../src/orxonox/tolua/tolua.pkg 49 DEPENDS tolua 50 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib 51 ) 52 35 53 ADD_EXECUTABLE( orxonox ${ORXONOX_SRC_FILES} ) 36 54 -
code/branches/camera/src/orxonox/Orxonox.cc
r1092 r1211 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 /** … … 299 322 300 323 Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2"); 301 HUD* orxonoxHud; 302 orxonoxHud = new HUD(); 303 orxonoxHud->setEnergyValue(20); 304 orxonoxHud->setEnergyDistr(20,20,60); 324 orxonoxHUD_ = new HUD(); 325 orxonoxHUD_->setEnergyValue(20); 326 orxonoxHUD_->setEnergyDistr(20,20,60); 305 327 hudOverlay->show(); 306 328 … … 410 432 return; 411 433 } 434 Ogre::Root& ogreRoot = Ogre::Root::getSingleton(); 435 412 436 413 437 // Contains the times of recently fired events … … 429 453 { 430 454 // Pump messages in all registered RenderWindows 455 // This calls the WindowEventListener objects. 431 456 Ogre::WindowEventUtilities::messagePump(); 432 457 … … 452 477 // don't forget to call _fireFrameStarted in ogre to make sure 453 478 // everything goes smoothly 454 Ogre::Root::getSingleton()._fireFrameStarted(evt);479 ogreRoot._fireFrameStarted(evt); 455 480 456 481 // server still renders at the moment 457 482 //if (mode_ != SERVER) 458 Ogre::Root::getSingleton()._updateAllRenderTargets(); // only render in non-server mode483 ogreRoot._updateAllRenderTargets(); // only render in non-server mode 459 484 460 485 // get current time … … 466 491 467 492 // again, just to be sure ogre works fine 468 Ogre::Root::getSingleton()._fireFrameEnded(evt);493 ogreRoot._fireFrameEnded(evt); 469 494 } 470 495 }
Note: See TracChangeset
for help on using the changeset viewer.