Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 14, 2008, 6:37:12 PM (16 years ago)
Author:
rgrieder
Message:
  • new folder structure for overlays:

orxonox/


overlays/

console/
hud/

  • Navigation —> HUDNavigation
  • HUD —> OverlayGroup (not yet begun with that except renaming and getHUD() instead of getSingleton())
  • moved HUD.oxo (file ending should stand for orxonox overlay) to media repository in overlay folder
  • fixed a bug with console noiseSize_ config value (was inverted..)
File:
1 moved

Legend:

Unmodified
Added
Removed
  • code/branches/hud/src/orxonox/overlays/OrxonoxOverlay.cc

    r1600 r1601  
    2828
    2929#include "OrxonoxStableHeaders.h"
    30 #include "HUDOverlay.h"
     30#include "OrxonoxOverlay.h"
    3131
    3232#include <OgreOverlayManager.h>
     
    3737namespace orxonox
    3838{
    39   unsigned int HUDOverlay::hudOverlayCounter_s = 0;
     39  unsigned int OrxonoxOverlay::hudOverlayCounter_s = 0;
    4040
    41   HUDOverlay::HUDOverlay()
     41  OrxonoxOverlay::OrxonoxOverlay()
    4242    : overlay_(0)
    4343    , windowAspectRatio_(1.0f)
     
    4747    , angle_(0.0f)
    4848    , position_(0.0f, 0.0f)
    49     , origin_(0.5f, 0.5f)
     49    , origin_(0.0f, 0.0f)
    5050  {
    51     RegisterObject(HUDOverlay);
     51    RegisterObject(OrxonoxOverlay);
    5252  }
    5353
    54   void HUDOverlay::XMLPort(Element& xmlElement, XMLPort::Mode mode)
     54  void OrxonoxOverlay::XMLPort(Element& xmlElement, XMLPort::Mode mode)
    5555  {
    5656    BaseObject::XMLPort(xmlElement, mode);
     
    5858    if (mode == XMLPort::LoadObject)
    5959    {
    60       overlay_ = Ogre::OverlayManager::getSingleton().create("HUDOverlay"
     60      overlay_ = Ogre::OverlayManager::getSingleton().create("OrxonoxOverlay"
    6161            + convertToString(hudOverlayCounter_s++) + "_" + this->getName());
    6262
     
    6565    }
    6666
    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);
    7272
    7373    if (mode == XMLPort::LoadObject)
     
    8181  }
    8282
    83   HUDOverlay::~HUDOverlay()
     83  OrxonoxOverlay::~OrxonoxOverlay()
    8484  {
    8585  }
    8686
    87   void HUDOverlay::changedVisibility()
     87  void OrxonoxOverlay::changedVisibility()
    8888  {
    8989    if (this->overlay_)
     
    9696  }
    9797
    98   void HUDOverlay::windowResized(int newWidth, int newHeight)
     98  void OrxonoxOverlay::windowResized(int newWidth, int newHeight)
    9999  {
    100100    this->windowAspectRatio_ = newWidth/(float)newHeight;
     
    103103  }
    104104
    105   void HUDOverlay::setAspectCorrection(bool val)
     105  void OrxonoxOverlay::setAspectCorrection(bool val)
    106106  {
    107107    if (val)
     
    126126      This function can be overriden by any derivative.
    127127  */
    128   void HUDOverlay::sizeChanged()
     128  void OrxonoxOverlay::sizeChanged()
    129129  {
    130130    this->overlay_->setScale(size_.x * sizeCorrection_.x, size_.y * sizeCorrection_.y);
     
    135135      This function can be overriden by any derivative.
    136136  */
    137   void HUDOverlay::angleChanged()
     137  void OrxonoxOverlay::angleChanged()
    138138  {
    139139    this->overlay_->setRotate(this->angle_);
     
    144144      This function can be overriden by any derivative.
    145145  */
    146   void HUDOverlay::positionChanged()
     146  void OrxonoxOverlay::positionChanged()
    147147  {
    148148    Vector2 scroll = (position_ - 0.5 - size_ * (origin_ - 0.5)) * 2.0;
Note: See TracChangeset for help on using the changeset viewer.