- Timestamp:
- Apr 8, 2009, 12:36:08 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/overlays/OrxonoxOverlay.cc
r2662 r2907 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;
Note: See TracChangeset
for help on using the changeset viewer.