Changeset 1590 for code/branches/hud/src/orxonox/hud/HUDOverlay.cc
- Timestamp:
- Jun 12, 2008, 12:57:45 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud/src/orxonox/hud/HUDOverlay.cc
r1588 r1590 33 33 #include "util/Convert.h" 34 34 #include "core/CoreIncludes.h" 35 #include "GraphicsEngine.h" 35 36 36 37 namespace orxonox 37 38 { 38 CreateFactory(HUDOverlay);39 39 unsigned int HUDOverlay::hudOverlayCounter_s = 0; 40 40 … … 49 49 BaseObject::XMLPort(xmlElement, mode); 50 50 51 overlay_ = Ogre::OverlayManager::getSingleton().create("HUDOverlay" 52 + convertToString(hudOverlayCounter_s++) + "_" + this->getName()); 51 if (mode == XMLPort::LoadObject) 52 { 53 overlay_ = Ogre::OverlayManager::getSingleton().create("HUDOverlay" 54 + convertToString(hudOverlayCounter_s++) + "_" + this->getName()); 55 56 this->windowWidth_ = GraphicsEngine::getSingleton().getWindowWidth(); 57 this->windowHeight_ = GraphicsEngine::getSingleton().getWindowHeight(); 58 this->windowAspectRatio_ = windowWidth_/(float)windowHeight_; 59 } 53 60 54 61 XMLPortParam(HUDOverlay, "scale", setScale, getScale, xmlElement, mode); … … 56 63 XMLPortParam(HUDOverlay, "rotation", setRotation, getRotation, xmlElement, mode); 57 64 58 this->overlay_->show(); 59 if (!this->isVisible()) 60 this->overlay_->hide(); 65 if (mode == XMLPort::LoadObject) 66 { 67 this->overlay_->show(); 68 if (!this->isVisible()) 69 this->overlay_->hide(); 70 } 61 71 } 62 72 … … 76 86 } 77 87 88 void HUDOverlay::windowResized(int newWidth, int newHeight) 89 { 90 this->windowWidth_ = newWidth; 91 this->windowHeight_ = newHeight; 92 this->windowAspectRatio_ = windowWidth_/(float)windowHeight_; 93 } 94 78 95 }
Note: See TracChangeset
for help on using the changeset viewer.