Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 29, 2015, 5:35:59 PM (9 years ago)
Author:
landauf
Message:

renamed SmartPtr to StrongPtr (now we have weak and strong pointers)

Location:
code/branches/core7/src/modules
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/modules/overlays/hud/HUDHealthBar.h

    r9667 r10555  
    115115        private:
    116116            WeakPtr<Pawn> owner_;
    117             SmartPtr<OverlayText> textoverlay_;
     117            StrongPtr<OverlayText> textoverlay_;
    118118            bool bUseBarColour_;
    119119            ColourValue textColour_;
  • code/branches/core7/src/modules/pickup/PickupSpawner.cc

    r9667 r10555  
    145145        if(GameMode::isMaster() && this->isActive())
    146146        {
    147             WeakPtr<PickupSpawner> spawner = this; // Create a smart pointer to keep the PickupSpawner alive until we iterated through all Pawns (in case a Pawn takes the last pickup)
     147            // TODO: why is this a WeakPtr when the comment says StrongPtr?
     148            WeakPtr<PickupSpawner> spawner = this; // Create a strong pointer to keep the PickupSpawner alive until we iterated through all Pawns (in case a Pawn takes the last pickup)
    148149
    149150            // Remove PickupCarriers from the blocked list if they have exceeded their time.
  • code/branches/core7/src/modules/pickup/items/ShrinkPickup.cc

    r9667 r10555  
    182182
    183183                // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
    184                 const std::list< SmartPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
     184                const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
    185185                int size = cameraPositions.size();
    186186                for(int index = 0; index < size; index++)
     
    208208
    209209                // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
    210                 const std::list< SmartPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
     210                const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
    211211                int size = cameraPositions.size();
    212212                for(int index = 0; index < size; index++)
     
    263263
    264264                // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
    265                 const std::list< SmartPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
     265                const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
    266266                int size = cameraPositions.size();
    267267                for(int index = 0; index < size; index++)
     
    304304
    305305                // Iterate over all camera positions and inversely move the camera to create a shrinking sensation.
    306                 const std::list< SmartPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
     306                const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();
    307307                int size = cameraPositions.size();
    308308                for(int index = 0; index < size; index++)
  • code/branches/core7/src/modules/tetris/Tetris.cc

    r9834 r10555  
    104104        }
    105105
    106         for (std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
     106        for (std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
    107107            (*it)->destroy();
    108108        this->stones_.clear();
     
    136136            return false;
    137137
    138         for(std::list<SmartPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
     138        for(std::list<StrongPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
    139139        {
    140140            const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
     
    192192
    193193        // check for collisions with all stones
    194         for(std::list<SmartPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
     194        for(std::list<StrongPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
    195195        {
    196196            //Vector3 currentStonePosition = rotateVector((*it)->getPosition(), this->activeBrick_->getRotationCount());
     
    469469        {
    470470            stonesPerRow = 0;
    471             for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
    472             {
    473                 std::list<SmartPtr<TetrisStone> >::iterator it_temp = it++;
     471            for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
     472            {
     473                std::list<StrongPtr<TetrisStone> >::iterator it_temp = it++;
    474474                correctPosition = static_cast<unsigned int>(((*it_temp)->getPosition().y - 5)/this->center_->getStoneSize());
    475475                if(correctPosition == row)
     
    491491    void Tetris::clearRow(unsigned int row)
    492492    {// clear the full row
    493         for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
     493        for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )
    494494        {
    495495            if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) == row)
     
    502502        }
    503503      // adjust height of stones above the deleted row //TODO: check if this could be a source of a bug.
    504         for(std::list<SmartPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
     504        for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
    505505        {
    506506            if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) > row)
  • code/branches/core7/src/modules/tetris/Tetris.h

    r9833 r10555  
    9494
    9595            WeakPtr<TetrisCenterpoint> center_; //!< The playing field.
    96             std::list<SmartPtr<TetrisStone> > stones_; //!< A list of all stones in play.
     96            std::list<StrongPtr<TetrisStone> > stones_; //!< A list of all stones in play.
    9797            WeakPtr<TetrisBrick> activeBrick_;
    9898            WeakPtr<TetrisBrick> futureBrick_;
Note: See TracChangeset for help on using the changeset viewer.