Changeset 2084 for code/branches/objecthierarchy/src/orxonox
- Timestamp:
- Nov 1, 2008, 2:51:02 PM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.cc
r2023 r2084 51 51 #include "core/input/KeyBinder.h" 52 52 #include "core/input/ExtendedInputState.h" 53 #include "core/Loader.h" 54 #include "core/XMLFile.h" 53 55 #include "overlays/console/InGameConsole.h" 54 56 #include "gui/GUIManager.h" 55 57 #include "tools/WindowEventListener.h" 58 #include "objects/Tickable.h" 56 59 #include "Settings.h" 57 60 … … 65 68 , renderWindow_(0) 66 69 , viewport_(0) 70 , bWindowEventListenerUpdateRequired_(false) 67 71 , inputManager_(0) 68 72 , console_(0) … … 77 81 , statisticsStartCount_(0) 78 82 , tickTime_(0) 83 , debugOverlay_(0) 79 84 { 80 85 RegisterRootObject(GSGraphics); … … 114 119 this->initialiseResources(); 115 120 116 117 // HACK: temporary: 118 //graphicsEngine_->renderWindow_ = this->renderWindow_; 119 //graphicsEngine_->root_ = this->ogreRoot_; 120 //graphicsEngine_->viewport_ = this->viewport_; 121 121 // We want to get informed whenever an object of type WindowEventListener is created 122 // in order to later update the window size. 123 bWindowEventListenerUpdateRequired_ = false; 124 RegisterConstructionCallback(GSGraphics, orxonox::WindowEventListener, requestWindowEventListenerUpdate); 125 126 // load debug overlay 127 COUT(3) << "Loading Debug Overlay..." << std::endl; 128 this->debugOverlay_ = new XMLFile(Settings::getDataPath() + "overlay/debug.oxo"); 129 Loader::open(debugOverlay_); 122 130 123 131 // Calls the InputManager which sets up the input devices. … … 166 174 //delete this->masterKeyBinder_; 167 175 delete this->inputManager_; 176 177 Loader::unload(this->debugOverlay_); 178 delete this->debugOverlay_; 168 179 169 180 // destroy render window … … 222 233 this->console_->tick(dt); 223 234 this->tickChild(time); 235 236 /*** HACK *** HACK ***/ 237 // Call the Tickable objects 238 for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it) 239 it->tick(time.getDeltaTime()); 240 /*** HACK *** HACK ***/ 241 242 if (this->bWindowEventListenerUpdateRequired_) 243 { 244 // Update all WindowEventListeners for the case a new one was created. 245 this->windowResized(this->renderWindow_); 246 this->bWindowEventListenerUpdateRequired_ = false; 247 } 224 248 225 249 unsigned long long timeAfterTick = time.getRealMicroseconds(); -
code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.h
r1891 r2084 77 77 void windowClosed (Ogre::RenderWindow* rw); 78 78 79 void requestWindowEventListenerUpdate() { this->bWindowEventListenerUpdateRequired_ = true; } 80 79 81 private: // variables 80 82 Ogre::RenderWindow* renderWindow_; //!< the current render window 81 83 Ogre::Viewport* viewport_; //!< default full size viewport 84 bool bWindowEventListenerUpdateRequired_; //!< True if a new WindowEventListener was created but not yet updated. 82 85 83 86 // managed singletons … … 97 100 unsigned long statisticsStartCount_; 98 101 unsigned int tickTime_; 102 XMLFile* debugOverlay_; 99 103 100 104 // config values -
code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.cc
r2073 r2084 163 163 void GSLevel::ticked(const Clock& time) 164 164 { 165 // Call the scene objects 166 for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it) 167 it->tick(time.getDeltaTime() * this->timeFactor_); 165 // Commented by 1337: Temporarily moved to GSGraphics. 166 //// Call the scene objects 167 //for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it) 168 // it->tick(time.getDeltaTime() * this->timeFactor_); 168 169 } 169 170 -
code/branches/objecthierarchy/src/orxonox/overlays/OrxonoxOverlay.cc
r2075 r2084 76 76 this->overlay_->add2D(this->background_); 77 77 78 // We'll have to get the aspect ratio manually for the first time. Afterwards windowResized() gets79 // called automatically by GSGraphics.80 this->windowAspectRatio_ = Ogre::OverlayManager::getSingleton().getViewportAspectRatio();78 // We'll have to set the aspect ratio to a default value first. 79 // GSGraphics gets informed about our construction here and can update us in the next tick. 80 this->windowAspectRatio_ = 1.0; 81 81 this->sizeCorrectionChanged(); 82 82
Note: See TracChangeset
for help on using the changeset viewer.