Changeset 1601 for code/branches/hud/src/orxonox/overlays/OrxonoxOverlay.cc
- Timestamp:
- Jun 14, 2008, 6:37:12 PM (16 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud/src/orxonox/overlays/OrxonoxOverlay.cc
r1600 r1601 28 28 29 29 #include "OrxonoxStableHeaders.h" 30 #include " HUDOverlay.h"30 #include "OrxonoxOverlay.h" 31 31 32 32 #include <OgreOverlayManager.h> … … 37 37 namespace orxonox 38 38 { 39 unsigned int HUDOverlay::hudOverlayCounter_s = 0;39 unsigned int OrxonoxOverlay::hudOverlayCounter_s = 0; 40 40 41 HUDOverlay::HUDOverlay()41 OrxonoxOverlay::OrxonoxOverlay() 42 42 : overlay_(0) 43 43 , windowAspectRatio_(1.0f) … … 47 47 , angle_(0.0f) 48 48 , position_(0.0f, 0.0f) 49 , origin_(0. 5f, 0.5f)49 , origin_(0.0f, 0.0f) 50 50 { 51 RegisterObject( HUDOverlay);51 RegisterObject(OrxonoxOverlay); 52 52 } 53 53 54 void HUDOverlay::XMLPort(Element& xmlElement, XMLPort::Mode mode)54 void OrxonoxOverlay::XMLPort(Element& xmlElement, XMLPort::Mode mode) 55 55 { 56 56 BaseObject::XMLPort(xmlElement, mode); … … 58 58 if (mode == XMLPort::LoadObject) 59 59 { 60 overlay_ = Ogre::OverlayManager::getSingleton().create(" HUDOverlay"60 overlay_ = Ogre::OverlayManager::getSingleton().create("OrxonoxOverlay" 61 61 + convertToString(hudOverlayCounter_s++) + "_" + this->getName()); 62 62 … … 65 65 } 66 66 67 XMLPortParam( HUDOverlay, "correctAspect", setAspectCorrection, getAspectCorrection, xmlElement, mode);68 XMLPortParam( HUDOverlay, "size", setSize, getSize, xmlElement, mode);69 XMLPortParam( HUDOverlay, "rotation", setRotation, getRotation, xmlElement, mode);70 XMLPortParam( HUDOverlay, "origin", setOrigin, getOrigin, xmlElement, mode);71 XMLPortParam( HUDOverlay, "position", setPosition, getPosition, xmlElement, mode);67 XMLPortParam(OrxonoxOverlay, "correctAspect", setAspectCorrection, getAspectCorrection, xmlElement, mode); 68 XMLPortParam(OrxonoxOverlay, "size", setSize, getSize, xmlElement, mode); 69 XMLPortParam(OrxonoxOverlay, "rotation", setRotation, getRotation, xmlElement, mode); 70 XMLPortParam(OrxonoxOverlay, "origin", setOrigin, getOrigin, xmlElement, mode); 71 XMLPortParam(OrxonoxOverlay, "position", setPosition, getPosition, xmlElement, mode); 72 72 73 73 if (mode == XMLPort::LoadObject) … … 81 81 } 82 82 83 HUDOverlay::~HUDOverlay()83 OrxonoxOverlay::~OrxonoxOverlay() 84 84 { 85 85 } 86 86 87 void HUDOverlay::changedVisibility()87 void OrxonoxOverlay::changedVisibility() 88 88 { 89 89 if (this->overlay_) … … 96 96 } 97 97 98 void HUDOverlay::windowResized(int newWidth, int newHeight)98 void OrxonoxOverlay::windowResized(int newWidth, int newHeight) 99 99 { 100 100 this->windowAspectRatio_ = newWidth/(float)newHeight; … … 103 103 } 104 104 105 void HUDOverlay::setAspectCorrection(bool val)105 void OrxonoxOverlay::setAspectCorrection(bool val) 106 106 { 107 107 if (val) … … 126 126 This function can be overriden by any derivative. 127 127 */ 128 void HUDOverlay::sizeChanged()128 void OrxonoxOverlay::sizeChanged() 129 129 { 130 130 this->overlay_->setScale(size_.x * sizeCorrection_.x, size_.y * sizeCorrection_.y); … … 135 135 This function can be overriden by any derivative. 136 136 */ 137 void HUDOverlay::angleChanged()137 void OrxonoxOverlay::angleChanged() 138 138 { 139 139 this->overlay_->setRotate(this->angle_); … … 144 144 This function can be overriden by any derivative. 145 145 */ 146 void HUDOverlay::positionChanged()146 void OrxonoxOverlay::positionChanged() 147 147 { 148 148 Vector2 scroll = (position_ - 0.5 - size_ * (origin_ - 0.5)) * 2.0;
Note: See TracChangeset
for help on using the changeset viewer.