Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 27, 2008, 4:08:51 AM (16 years ago)
Author:
landauf
Message:

many changes, most important: BaseObject takes now a pointer to it's creator which is needed to build a level hierarchy (with different scenes)

Location:
code/branches/objecthierarchy/src/orxonox/overlays/hud
Files:
10 edited

Legend:

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

    r2012 r2019  
    3939
    4040#include "GraphicsEngine.h"
    41 #include "objects/infos/Level.h"
     41#include "LevelManager.h"
    4242#include "objects/infos/PlayerInfo.h"
    4343#include "overlays/console/InGameConsole.h"
     
    5050    CreateFactory(ChatOverlay);
    5151
    52     ChatOverlay::ChatOverlay()
     52    ChatOverlay::ChatOverlay(BaseObject* creator) : OverlayText(creator)
    5353    {
    5454        RegisterObject(ChatOverlay);
     
    7676            std::string name = "unknown";
    7777
    78             PlayerInfo* player = Level::getClient(senderID);
     78            PlayerInfo* player = LevelManager::getInstance().getClient(senderID);
    7979            if (player)
    8080                name = player->getName();
  • code/branches/objecthierarchy/src/orxonox/overlays/hud/ChatOverlay.h

    r1968 r2019  
    4242    {
    4343        public:
    44             ChatOverlay();
     44            ChatOverlay(BaseObject* creator);
    4545            ~ChatOverlay();
    4646
  • code/branches/objecthierarchy/src/orxonox/overlays/hud/HUDBar.cc

    r1854 r2019  
    3838
    3939#include "util/Convert.h"
     40#include "util/String.h"
    4041#include "core/CoreIncludes.h"
    4142#include "core/XMLPort.h"
     
    4546    CreateFactory(BarColour);
    4647
    47     BarColour::BarColour()
    48         : position_(0.0)
     48    BarColour::BarColour(BaseObject* creator) : BaseObject(creator), position_(0.0)
    4949    {
    5050        RegisterObject(BarColour);
     
    6363    unsigned int HUDBar::materialcount_s = 0;
    6464
    65     HUDBar::HUDBar()
    66         : bar_(0)
    67         , textureUnitState_(0)
     65    HUDBar::HUDBar(BaseObject* creator) : OrxonoxOverlay(creator), bar_(0), textureUnitState_(0)
    6866    {
    6967        RegisterObject(HUDBar);
     
    9290
    9391            this->bar_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
    94                 .createOverlayElement("Panel", "HUDBar_bar_" + getUniqueNumberStr()));
     92                .createOverlayElement("Panel", "HUDBar_bar_" + getUniqueNumberString()));
    9593            this->bar_->setMaterialName(materialname);
    9694            this->background_->addChild(bar_);
  • code/branches/objecthierarchy/src/orxonox/overlays/hud/HUDBar.h

    r1747 r2019  
    4444    {
    4545    public:
    46         BarColour();
     46        BarColour(BaseObject* creator);
    4747        ~BarColour() { }
    4848
     
    6464    {
    6565    public:
    66         HUDBar();
     66        HUDBar(BaseObject* creator);
    6767        virtual ~HUDBar();
    6868
  • code/branches/objecthierarchy/src/orxonox/overlays/hud/HUDNavigation.cc

    r1993 r2019  
    4646    CreateFactory(HUDNavigation);
    4747
    48     HUDNavigation::HUDNavigation()
    49         : navMarker_(0)
     48    HUDNavigation::HUDNavigation(BaseObject* creator)
     49        : OrxonoxOverlay(creator)
     50        , navMarker_(0)
    5051        , aimMarker_(0)
    5152        , navText_(0)
     
    7273            // create nav text
    7374            navText_ = static_cast<Ogre::TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton()
    74                 .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberStr()));
     75                .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberString()));
    7576
    7677            // create nav marker
    7778            navMarker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
    78                 .createOverlayElement("Panel", "HUDNavigation_navMarker_" + getUniqueNumberStr()));
     79                .createOverlayElement("Panel", "HUDNavigation_navMarker_" + getUniqueNumberString()));
    7980            navMarker_->setMaterialName("Orxonox/NavArrows");
    8081            wasOutOfView_ = true; // just to ensure the material is changed right the first time..
     
    8283            // create aim marker
    8384            aimMarker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
    84                 .createOverlayElement("Panel", "HUDNavigation_aimMarker_" + getUniqueNumberStr()));
     85                .createOverlayElement("Panel", "HUDNavigation_aimMarker_" + getUniqueNumberString()));
    8586            aimMarker_->setMaterialName("Orxonox/NavCrosshair");
    8687
     
    112113            return this->navText_->getFontName();
    113114        else
    114             return blankString;
     115            return BLANKSTRING;
    115116    }
    116117
  • code/branches/objecthierarchy/src/orxonox/overlays/hud/HUDNavigation.h

    r1747 r2019  
    4141    {
    4242    public:
    43         HUDNavigation();
     43        HUDNavigation(BaseObject* creator);
    4444        ~HUDNavigation();
    4545
  • code/branches/objecthierarchy/src/orxonox/overlays/hud/HUDRadar.cc

    r1916 r2019  
    3535
    3636#include "util/Math.h"
     37#include "util/String.h"
    3738#include "core/ConsoleCommand.h"
    3839#include "core/CoreIncludes.h"
     
    4546    CreateFactory(HUDRadar);
    4647
    47     HUDRadar::HUDRadar()
    48         : marker_(0)
     48    HUDRadar::HUDRadar(BaseObject* creator) : OrxonoxOverlay(creator), marker_(0)
    4949    {
    5050        RegisterObject(HUDRadar);
     
    6969        {
    7070            marker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
    71                 .createOverlayElement("Panel", "HUDRadar_marker_" + getUniqueNumberStr()));
     71                .createOverlayElement("Panel", "HUDRadar_marker_" + getUniqueNumberString()));
    7272            marker_->setMaterialName("Orxonox/RadarMarker");
    7373            overlay_->add2D(marker_);
     
    107107            // we have to create a new entry
    108108            panel = static_cast<Ogre::PanelOverlayElement*>(
    109                 Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "RadarDot" + getUniqueNumberStr()));
     109                Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "RadarDot" + getUniqueNumberString()));
    110110            radarDots_.push_back(panel);
    111111            // get right material
  • code/branches/objecthierarchy/src/orxonox/overlays/hud/HUDRadar.h

    r1819 r2019  
    4545    {
    4646    public:
    47         HUDRadar();
     47        HUDRadar(BaseObject* creator);
    4848        ~HUDRadar();
    4949
  • code/branches/objecthierarchy/src/orxonox/overlays/hud/HUDSpeedBar.cc

    r1916 r2019  
    3636    CreateFactory(HUDSpeedBar);
    3737
    38     HUDSpeedBar::HUDSpeedBar()
     38    HUDSpeedBar::HUDSpeedBar(BaseObject* creator) : HUDBar(creator)
    3939    {
    4040        RegisterObject(HUDSpeedBar);
  • code/branches/objecthierarchy/src/orxonox/overlays/hud/HUDSpeedBar.h

    r1747 r2019  
    4141    {
    4242    public:
    43         HUDSpeedBar();
     43        HUDSpeedBar(BaseObject* creator);
    4444        ~HUDSpeedBar();
    4545
Note: See TracChangeset for help on using the changeset viewer.