Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 13, 2009, 5:05:17 PM (16 years ago)
Author:
dafrick
Message:

Hopefully merged trunk successfully into pickup branch.

Location:
code/branches/pickup
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup

  • code/branches/pickup/src/orxonox/worldentities/ControllableEntity.cc

    r5781 r5935  
    9696
    9797            if (this->xmlcontroller_)
    98                 delete this->xmlcontroller_;
     98                this->xmlcontroller_->destroy();
    9999
    100100            if (this->hud_)
    101                 delete this->hud_;
     101                this->hud_->destroy();
    102102
    103103            if (this->camera_)
    104                 delete this->camera_;
    105 
    106             for (std::list<CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    107                 delete (*it);
     104                this->camera_->destroy();
     105
     106            for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     107                (*it)->destroy();
    108108
    109109            if (this->getScene()->getSceneManager())
     
    153153    {
    154154        unsigned int i = 0;
    155         for (std::list<CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     155        for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    156156        {
    157157            if (i == index)
     
    172172            else if (this->cameraPositions_.size() > 0)
    173173            {
    174                 for (std::list<CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     174                for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    175175                {
    176176                    if ((*it) == this->camera_->getParent())
     
    238238            {
    239239                this->client_overwrite_ = this->server_overwrite_;
    240                 this->setObjectMode(ObjectDirection::Bidirectional);
     240                this->setSyncMode(ObjectDirection::Bidirectional);
    241241            }
    242242        }
     
    254254        this->bHasLocalController_ = false;
    255255        this->bHasHumanController_ = false;
    256         this->setObjectMode(ObjectDirection::ToClient);
     256        this->setSyncMode(ObjectDirection::ToClient);
    257257
    258258        this->changedPlayer();
    259259
    260260        if (this->bDestroyWhenPlayerLeft_)
    261             delete this;
     261            this->destroy();
    262262    }
    263263
     
    275275    void ControllableEntity::startLocalHumanControl()
    276276    {
    277         if (!this->camera_)
     277        if (!this->camera_ && GameMode::showsGraphics())
    278278        {
    279279            this->camera_ = new Camera(this);
     
    287287        }
    288288
    289         if (!this->hud_)
     289        if (!this->hud_ && GameMode::showsGraphics())
    290290        {
    291291            if (this->hudtemplate_ != "")
     
    303303        {
    304304            this->camera_->detachFromParent();
    305             delete this->camera_;
     305            this->camera_->destroy();
    306306            this->camera_ = 0;
    307307        }
     
    309309        if (this->hud_)
    310310        {
    311             delete this->hud_;
     311            this->hud_->destroy();
    312312            this->hud_ = 0;
    313313        }
     
    333333        if (parent)
    334334        {
    335             for (std::list<CameraPosition*>::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     335            for (std::list<SmartPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    336336                if ((*it)->getIsAbsolute())
    337337                    parent->attach((*it));
Note: See TracChangeset for help on using the changeset viewer.