Changeset 2896 for code/trunk/src/orxonox/overlays
- Timestamp:
- Apr 6, 2009, 1:59:00 AM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/gui merged: 2796,2798-2801,2805,2807-2808,2811,2814-2817,2834,2840-2850,2853-2854,2859,2862-2863,2869,2875,2887,2892
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r2662 r2896 39 39 #include <OgreOverlayManager.h> 40 40 #include <OgrePanelOverlayElement.h> 41 #include <OgreRenderWindow.h> 42 41 43 #include "util/Convert.h" 42 44 #include "util/Exception.h" 43 45 #include "util/String.h" 44 #include "core/ Core.h"46 #include "core/GameMode.h" 45 47 #include "core/CoreIncludes.h" 46 48 #include "core/XMLPort.h" 47 49 #include "core/ConsoleCommand.h" 50 #include "GraphicsManager.h" 48 51 49 52 namespace orxonox … … 64 67 this->group_ = 0; 65 68 66 if (! Core::showsGraphics())69 if (!GameMode::showsGraphics()) 67 70 ThrowException(NoGraphics, "Can't create OrxonoxOverlay, graphics engine not initialized"); 68 71 … … 77 80 this->overlay_->add2D(this->background_); 78 81 79 // We'll have to set the aspect ratio to a default value first.80 // GSGraphics gets informed about our construction here and can update us in the next tick.81 this->windowAspectRatio_ = 1.0;82 // Get aspect ratio from the render window. Later on, we get informed automatically 83 Ogre::RenderWindow* defaultWindow = GraphicsManager::getInstance().getRenderWindow(); 84 this->windowAspectRatio_ = (float)defaultWindow->getWidth() / defaultWindow->getHeight(); 82 85 this->sizeCorrectionChanged(); 83 86 … … 175 178 /** 176 179 @brief 177 Called by the Graphics Enginewhenever the window size changes.180 Called by the GraphicsManager whenever the window size changes. 178 181 Calculates the aspect ratio only. 179 182 */ 180 void OrxonoxOverlay::windowResized( int newWidth,int newHeight)183 void OrxonoxOverlay::windowResized(unsigned int newWidth, unsigned int newHeight) 181 184 { 182 185 this->windowAspectRatio_ = newWidth/(float)newHeight; -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
r2890 r2896 200 200 201 201 private: 202 void windowResized( int newWidth,int newHeight);202 void windowResized(unsigned int newWidth, unsigned int newHeight); 203 203 204 204 static unsigned int hudOverlayCounter_s; //!< Static counter for hud elements -
code/trunk/src/orxonox/overlays/console/InGameConsole.cc
r2087 r2896 42 42 #include "util/Convert.h" 43 43 #include "util/Debug.h" 44 #include "core/Clock.h" 44 45 #include "core/CoreIncludes.h" 45 46 #include "core/ConfigValueIncludes.h" … … 172 173 { 173 174 // create the corresponding input state 174 inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("console", 40);175 inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("console", false, false, InputStatePriority::Console); 175 176 inputState_->setKeyHandler(Shell::getInstance().getInputBuffer()); 176 177 bHidesAllInputChanged(); … … 347 348 @brief Used to control the actual scrolling and the cursor. 348 349 */ 349 void InGameConsole:: tick(float dt)350 void InGameConsole::update(const Clock& time) 350 351 { 351 352 if (this->scroll_ != 0) … … 358 359 // enlarge oldTop a little bit so that this exponential function 359 360 // reaches 0 before infinite time has passed... 360 float deltaScroll = (oldTop - 0.01) * dt* this->scrollSpeed_;361 float deltaScroll = (oldTop - 0.01) * time.getDeltaTime() * this->scrollSpeed_; 361 362 if (oldTop - deltaScroll >= 0) 362 363 { … … 373 374 // scrolling up 374 375 // note: +0.01 for the same reason as when scrolling down 375 float deltaScroll = (1.2 * this->relativeHeight + 0.01 + oldTop) * dt* this->scrollSpeed_;376 float deltaScroll = (1.2 * this->relativeHeight + 0.01 + oldTop) * time.getDeltaTime() * this->scrollSpeed_; 376 377 if (oldTop - deltaScroll <= -1.2 * this->relativeHeight) 377 378 { … … 388 389 if (this->bActive_) 389 390 { 390 this->cursor_ += dt;391 this->cursor_ += time.getDeltaTime(); 391 392 if (this->cursor_ >= this->blinkTime) 392 393 { … … 409 410 @brief Resizes the console elements. Call if window size changes. 410 411 */ 411 void InGameConsole::windowResized( int newWidth,int newHeight)412 void InGameConsole::windowResized(unsigned int newWidth, unsigned int newHeight) 412 413 { 413 414 this->windowW_ = newWidth; -
code/trunk/src/orxonox/overlays/console/InGameConsole.h
r2087 r2896 53 53 void setConfigValues(); 54 54 55 v irtual void tick(float dt);55 void update(const Clock& time); 56 56 57 57 static InGameConsole& getInstance() { assert(singletonRef_s); return *singletonRef_s; } … … 81 81 void print(const std::string& text, int index, bool alwaysShift = false); 82 82 83 void windowResized( int newWidth,int newHeight);83 void windowResized(unsigned int newWidth, unsigned int newHeight); 84 84 85 85 // config value related -
code/trunk/src/orxonox/overlays/debug/DebugFPSText.cc
r2662 r2896 30 30 #include "DebugFPSText.h" 31 31 #include <OgreTextAreaOverlayElement.h> 32 #include "util/Convert.h" 32 33 #include "core/CoreIncludes.h" 33 #include "GraphicsEngine.h" 34 #include "util/Convert.h" 34 #include "core/Game.h" 35 35 36 36 namespace orxonox … … 51 51 SUPER(DebugFPSText, tick, dt); 52 52 53 float fps = G raphicsEngine::getInstance().getAverageFramesPerSecond();53 float fps = Game::getInstance().getAvgFPS(); 54 54 this->setCaption(convertToString(fps)); 55 55 } -
code/trunk/src/orxonox/overlays/debug/DebugRTRText.cc
r2662 r2896 32 32 #include "core/CoreIncludes.h" 33 33 #include "util/Convert.h" 34 #include " GraphicsEngine.h"34 #include "core/Game.h" 35 35 36 36 namespace orxonox … … 51 51 SUPER(DebugRTRText, tick, dt); 52 52 53 float rtr = G raphicsEngine::getInstance().getAverageTickTime();53 float rtr = Game::getInstance().getAvgTickTime(); 54 54 this->setCaption(convertToString(rtr)); 55 55 } -
code/trunk/src/orxonox/overlays/hud/HUDRadar.cc
r2662 r2896 94 94 void HUDRadar::displayObject(RadarViewable* object, bool bIsMarked) 95 95 { 96 if (object == (RadarViewable*)this->owner_)96 if (object == static_cast<RadarViewable*>(this->owner_)) 97 97 return; 98 98
Note: See TracChangeset
for help on using the changeset viewer.