Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2015, 10:25:42 PM (9 years ago)
Author:
landauf
Message:

replace 'NULL' by 'nullptr'

Location:
code/branches/cpp11_v2/src/orxonox/worldentities
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/orxonox/worldentities/ControllableEntity.cc

    r10624 r10765  
    6262        this->client_overwrite_ = 0;
    6363        this->player_ = 0;
    64         this->formerPlayer_ = NULL;
     64        this->formerPlayer_ = nullptr;
    6565        this->playerID_ = OBJECTID_UNKNOWN;
    6666        this->hud_ = 0;
     
    194194    bool ControllableEntity::setCameraPosition(unsigned int index)
    195195    {
    196         if(this->camera_ != NULL && this->cameraPositions_.size() > 0)
     196        if(this->camera_ != nullptr && this->cameraPositions_.size() > 0)
    197197        {
    198198            if(index >= this->cameraPositions_.size())
     
    350350        this->bHasLocalController_ = player->isLocalPlayer();
    351351        this->bHasHumanController_ = player->isHumanPlayer();
    352         if(controller_ != NULL)
     352        if(controller_ != nullptr)
    353353            this->team_ = controller_->getTeam(); // forward controller team number
    354354
     
    434434    void ControllableEntity::destroyHud(void)
    435435    {
    436         if (this->hud_ != NULL)
     436        if (this->hud_ != nullptr)
    437437        {
    438438            this->hud_->destroy();
    439             this->hud_ = NULL;
     439            this->hud_ = nullptr;
    440440        }
    441441    }
  • code/branches/cpp11_v2/src/orxonox/worldentities/EffectContainer.cc

    r9667 r10765  
    4444    EffectContainer::EffectContainer(Context* context)
    4545        : BaseObject(context)
    46         , lua_(NULL)
     46        , lua_(nullptr)
    4747    {
    4848        RegisterObject(EffectContainer);
     
    9292            if (i == index)
    9393                return (*it);
    94         return NULL;
     94        return nullptr;
    9595    }
    9696
  • code/branches/cpp11_v2/src/orxonox/worldentities/WorldEntity.cc

    r10624 r10765  
    563563    void WorldEntity::detachOgreObject(Ogre::MovableObject* object)
    564564    {
    565         object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(NULL)));
     565        object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(nullptr)));
    566566        this->node_->detachObject(object);
    567567    }
     
    660660    {
    661661        // If physics is enabled scale the attached CollisionShape.
    662         /*if (this->hasPhysics() && this->collisionShape_ != NULL)
     662        /*if (this->hasPhysics() && this->collisionShape_ != nullptr)
    663663        {
    664664            this->collisionShape_->setScale3D(scale);
  • code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.cc

    r10624 r10765  
    9494        for (unsigned int i=0; i < this->getAttachedObjects().size(); i++)
    9595        {
    96             if (this->getAttachedObject(i) == NULL)
     96            if (this->getAttachedObject(i) == nullptr)
    9797            {
    9898                break;
     
    151151                return it->second;
    152152        }
    153         return NULL;
     153        return nullptr;
    154154    }
    155155
     
    160160    void ModularSpaceShip::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
    161161    {
    162         if (cs != NULL && this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != NULL)
     162        if (cs != nullptr && this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != nullptr)
    163163            this->getPartOfEntity((StaticEntity*)(cs->getUserPointer()))->handleHit(damage, healthdamage, shielddamage, originator);
    164164        else
     
    212212    void ModularSpaceShip::addShipPart(ShipPart* part)
    213213    {
    214         OrxAssert(part != NULL, "The ShipPart cannot be NULL.");
     214        OrxAssert(part != nullptr, "The ShipPart cannot be nullptr.");
    215215        this->partList_.push_back(part);
    216216        part->setParent(this);
     
    222222        Get the i-th ShipPart of the SpaceShip.
    223223    @return
    224         Returns a pointer to the i-the ShipPart. NULL if there is no ShipPart with that index.
     224        Returns a pointer to the i-the ShipPart. nullptr if there is no ShipPart with that index.
    225225    */
    226226    ShipPart* ModularSpaceShip::getShipPart(unsigned int index)
    227227    {
    228228        if(this->partList_.size() <= index)
    229             return NULL;
     229            return nullptr;
    230230        else
    231231            return this->partList_[index];
     
    238238        The name of the ShipPart to be returned.
    239239    @return
    240         Pointer to the ShipPart with the given name, or NULL if not found.
     240        Pointer to the ShipPart with the given name, or nullptr if not found.
    241241    */
    242242    ShipPart* ModularSpaceShip::getShipPartByName(std::string name)
     
    250250        }
    251251        orxout(internal_warning) << "Couldn't find ShipPart with name \"" << name << "\"." << endl;
    252         return NULL;
     252        return nullptr;
    253253    }
    254254
  • code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.h

    r10262 r10765  
    109109            ShipPart* getPartOfEntity(StaticEntity* entity) const;
    110110
    111             virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL);
     111            virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = nullptr, const btCollisionShape* cs = nullptr);
    112112
    113113            static void killShipPartStatic(std::string name);
  • code/branches/cpp11_v2/src/orxonox/worldentities/pawns/Pawn.h

    r10437 r10765  
    208208
    209209            //virtual void damage(float damage, Pawn* originator = 0);
    210             virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL);
     210            virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = nullptr, const btCollisionShape* cs = nullptr);
    211211
    212212            bool bAlive_;
     
    215215                { return new std::vector<PickupCarrier*>(); }
    216216            virtual PickupCarrier* getCarrierParent(void) const
    217                 { return NULL; }
     217                { return nullptr; }
    218218
    219219
  • code/branches/cpp11_v2/src/orxonox/worldentities/pawns/SpaceShip.cc

    r10216 r10765  
    4848    RegisterClass(SpaceShip);
    4949
    50     SpaceShip::SpaceShip(Context* context) : Pawn(context), boostBlur_(NULL)
     50    SpaceShip::SpaceShip(Context* context) : Pawn(context), boostBlur_(nullptr)
    5151    {
    5252        RegisterObject(SpaceShip);
     
    196196            if(this->bEnableMotionBlur_)
    197197            {
    198                 if (this->boostBlur_ == NULL && this->hasLocalController() && this->hasHumanController())
     198                if (this->boostBlur_ == nullptr && this->hasLocalController() && this->hasHumanController())
    199199                {
    200200                    this->boostBlur_ = new Shader(this->getScene()->getSceneManager());
     
    305305    void SpaceShip::addEngine(orxonox::Engine* engine)
    306306    {
    307         OrxAssert(engine != NULL, "The engine cannot be NULL.");
     307        OrxAssert(engine != nullptr, "The engine cannot be nullptr.");
    308308        this->engineList_.push_back(engine);
    309309        engine->addToSpaceShip(this);
     
    330330        Get the i-th Engine of the SpaceShip.
    331331    @return
    332         Returns a pointer to the i-the Engine. NULL if there is no Engine with that index.
     332        Returns a pointer to the i-the Engine. nullptr if there is no Engine with that index.
    333333    */
    334334    Engine* SpaceShip::getEngine(unsigned int i)
    335335    {
    336336        if(this->engineList_.size() >= i)
    337             return NULL;
     337            return nullptr;
    338338        else
    339339            return this->engineList_[i];
     
    346346        The name of the engine to be returned.
    347347    @return
    348         Pointer to the engine with the given name, or NULL if not found.
     348        Pointer to the engine with the given name, or nullptr if not found.
    349349    */
    350350    Engine* SpaceShip::getEngineByName(const std::string& name)
     
    355355
    356356        orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl;
    357         return NULL;
     357        return nullptr;
    358358    }
    359359
     
    465465    void SpaceShip::changedEnableMotionBlur()
    466466    {
    467         if (!this->bEnableMotionBlur_ && this->boostBlur_ != NULL)
     467        if (!this->bEnableMotionBlur_ && this->boostBlur_ != nullptr)
    468468        {
    469469            delete this->boostBlur_;
    470             this->boostBlur_ = NULL;
     470            this->boostBlur_ = nullptr;
    471471        }
    472472    }
     
    510510    {
    511511        Camera* camera = CameraManager::getInstance().getActiveCamera();
    512         if(camera != NULL)
     512        if(camera != nullptr)
    513513        {
    514514            this->cameraOriginalPosition_ = camera->getPosition();
Note: See TracChangeset for help on using the changeset viewer.