Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 29, 2015, 6:18:30 PM (9 years ago)
Author:
landauf
Message:

cleanup: no need to pass/return WeakPtrs to/from functions. normal pointers are enough.

Location:
code/branches/core7/src/orxonox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/orxonox/gametypes/Dynamicmatch.cc

    r9945 r10557  
    310310        if (spaceship)
    311311        {
    312             WeakPtr<SpaceShip>* ptr = new WeakPtr<SpaceShip>(spaceship);
    313             if(ptr == NULL)
    314                 return;
    315312            spaceship->addSpeedFactor(5);
    316313            ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
    317             executor->setDefaultValue(0, ptr);
     314            executor->setDefaultValue(0, spaceship);
    318315            new Timer(10, false, executor, true);
    319316        }
     
    593590    }
    594591
    595     void Dynamicmatch::resetSpeedFactor(WeakPtr<SpaceShip>* ptr)// helper function
    596     {
    597         if (*ptr)
    598         {
    599             (*ptr)->addSpeedFactor(1.0f/5.0f);
    600         }
    601         delete ptr;
     592    void Dynamicmatch::resetSpeedFactor(SpaceShip* spaceship)// helper function
     593    {
     594        if (spaceship)
     595        {
     596            spaceship->addSpeedFactor(1.0f/5.0f);
     597        }
    602598    }
    603599
  • code/branches/core7/src/orxonox/gametypes/Dynamicmatch.h

    r9676 r10557  
    7777            virtual void rewardPig();
    7878            void grantPigBoost(SpaceShip* spaceship); // Grant the piggy a boost.
    79             void resetSpeedFactor(WeakPtr<SpaceShip>* ptr);
     79            void resetSpeedFactor(SpaceShip* spaceship);
    8080            void tick (float dt);// used to end the game
    8181            SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
  • code/branches/core7/src/orxonox/infos/PlayerInfo.cc

    r10362 r10557  
    186186
    187187        this->controllableEntity_->destroyHud(); // HACK-ish
    188         this->previousControllableEntity_.push_back(WeakPtr<ControllableEntity>(this->controllableEntity_));
     188        this->previousControllableEntity_.push_back(this->controllableEntity_);
    189189        this->controllableEntity_ = entity;
    190190        this->controllableEntityID_ = entity->getObjectID();
  • code/branches/core7/src/orxonox/interfaces/InterfaceCompilation.cc

    r10362 r10557  
    7272    {
    7373        assert(pawn);
    74         this->pawn_ = WeakPtr<Pawn>(pawn);
     74        this->pawn_ = pawn;
    7575        if (pawn)
    76             this->player_ = WeakPtr<PlayerInfo>(pawn->getPlayer());
     76            this->player_ = pawn->getPlayer();
    7777    }
    7878
  • code/branches/core7/src/orxonox/sound/SoundManager.cc

    r10555 r10557  
    419419    }
    420420
    421     void SoundManager::fadeIn(const StrongPtr<AmbientSound>& sound)
     421    void SoundManager::fadeIn(AmbientSound* sound)
    422422    {
    423423        // If we're already fading out --> remove that
     
    435435    }
    436436
    437     void SoundManager::fadeOut(const StrongPtr<AmbientSound>& sound)
     437    void SoundManager::fadeOut(AmbientSound* sound)
    438438    {
    439439        // If we're already fading in --> remove that
  • code/branches/core7/src/orxonox/sound/SoundManager.h

    r10555 r10557  
    106106    private:
    107107        void processCrossFading(float dt);
    108         void fadeIn(const StrongPtr<AmbientSound>& sound);
    109         void fadeOut(const StrongPtr<AmbientSound>& sound);
     108        void fadeIn(AmbientSound* sound);
     109        void fadeOut(AmbientSound* sound);
    110110
    111111        void checkFadeStepValidity();
Note: See TracChangeset for help on using the changeset viewer.