Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 21, 2016, 1:59:04 PM (9 years ago)
Author:
muemart
Message:

Fix some clang-tidy warnings.
Also, Serialise.h was doing some C-style casts that ended up being const casts. I moved those const casts as close to the source as possible and changed the loadAndIncrease functions to not do that.

Location:
code/trunk/src/modules/tetris
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/tetris/Tetris.cc

    r11071 r11083  
    140140            const Vector3& currentStonePosition = someStone->getPosition(); //!< Saves the position of the currentStone
    141141
    142             if((position.x == currentStonePosition.x) && abs(position.y-currentStonePosition.y) < this->center_->getStoneSize())
     142            if((position.x == currentStonePosition.x) && std::abs(position.y-currentStonePosition.y) < this->center_->getStoneSize())
    143143                return false;
    144144        }
     
    222222        if(position.y < this->center_->getStoneSize()/2.0f) //!< If the stone has reached the bottom of the level
    223223        {
    224             float baseOffset = abs(stone->getPosition().y);
     224            float baseOffset = std::abs(stone->getPosition().y);
    225225            if (this->activeBrick_->getRotationCount() == 1 || this->activeBrick_->getRotationCount() == 3)
    226                 baseOffset = abs(stone->getPosition().x);
     226                baseOffset = std::abs(stone->getPosition().x);
    227227            float yOffset = baseOffset + this->center_->getStoneSize()/2.0f;//calculate offset
    228228            if(yOffset < 0) //catch brake-throughs
  • code/trunk/src/modules/tetris/TetrisBrick.cc

    r11071 r11083  
    213213        {
    214214            const Vector3& position = this->getPosition();
    215             Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z);
     215            Vector3 newPos = Vector3(position.x+value.x/std::abs(value.x)*this->size_, position.y, position.z);
    216216            if(!this->isValidMove(newPos))
    217217                return;
  • code/trunk/src/modules/tetris/TetrisStone.cc

    r9667 r11083  
    9292        {
    9393            const Vector3& position = this->getPosition();
    94             Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z);
     94            Vector3 newPos = Vector3(position.x+value.x/std::abs(value.x)*this->size_, position.y, position.z);
    9595            if(!this->tetris_->isValidMove(this, newPos))
    9696                return;
Note: See TracChangeset for help on using the changeset viewer.