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/modules/jump
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/modules/jump/Jump.cc

    r10733 r10765  
    8383        SUPER(Jump, tick, dt);
    8484
    85         if (figure_ != NULL)
     85        if (figure_ != nullptr)
    8686        {
    8787            Vector3 figurePosition = figure_->getPosition();
     
    130130
    131131
    132             if (camera != NULL)
     132            if (camera != nullptr)
    133133            {
    134134                Vector3 cameraPosition = Vector3(0, totalScreenShift_, 0);
     
    275275    void Jump::start()
    276276    {
    277         if (center_ != NULL) // There needs to be a JumpCenterpoint, i.e. the area the game takes place.
    278         {
    279             if (figure_ == NULL)
     277        if (center_ != nullptr) // There needs to be a JumpCenterpoint, i.e. the area the game takes place.
     278        {
     279            if (figure_ == nullptr)
    280280            {
    281281                figure_ = new JumpFigure(center_->getContext());
     
    298298        Deathmatch::start();
    299299
    300         if (figure_ != NULL)
     300        if (figure_ != nullptr)
    301301        {
    302302            camera = figure_->getCamera();
     
    325325        assert(player);
    326326
    327         if (figure_->getPlayer() == NULL)
     327        if (figure_->getPlayer() == nullptr)
    328328        {
    329329            player->startControl(figure_);
     
    334334    PlayerInfo* Jump::getPlayer() const
    335335    {
    336         if (this->figure_ != NULL)
     336        if (this->figure_ != nullptr)
    337337        {
    338338            return this->figure_->getPlayer();
     
    346346    void Jump::addPlatform(JumpPlatform* newPlatform, std::string platformTemplate, float xPosition, float zPosition)
    347347    {
    348         if (newPlatform != NULL && center_ != NULL)
     348        if (newPlatform != nullptr && center_ != nullptr)
    349349        {
    350350            newPlatform->addTemplate(platformTemplate);
     
    414414    {
    415415        JumpProjectile* newProjectile = new JumpProjectile(center_->getContext());
    416         if (newProjectile != NULL && center_ != NULL)
     416        if (newProjectile != nullptr && center_ != nullptr)
    417417        {
    418418            newProjectile->addTemplate(center_->getProjectileTemplate());
     
    427427    {
    428428        JumpSpring* newSpring = new JumpSpring(center_->getContext());
    429         if (newSpring != NULL && center_ != NULL)
     429        if (newSpring != nullptr && center_ != nullptr)
    430430        {
    431431            newSpring->addTemplate(center_->getSpringTemplate());
     
    440440    {
    441441        JumpSpring* newSpring = new JumpSpring(center_->getContext());
    442         if (newSpring != NULL && center_ != NULL)
     442        if (newSpring != nullptr && center_ != nullptr)
    443443        {
    444444            newSpring->addTemplate(center_->getSpringTemplate());
     
    453453    {
    454454        JumpRocket* newRocket = new JumpRocket(center_->getContext());
    455         if (newRocket != NULL && center_ != NULL)
     455        if (newRocket != nullptr && center_ != nullptr)
    456456        {
    457457            newRocket->addTemplate(center_->getRocketTemplate());
     
    466466    {
    467467        JumpRocket* newRocket = new JumpRocket(center_->getContext());
    468         if (newRocket != NULL && center_ != NULL)
     468        if (newRocket != nullptr && center_ != nullptr)
    469469        {
    470470            newRocket->addTemplate(center_->getRocketTemplate());
     
    479479    {
    480480        JumpPropeller* newPropeller = new JumpPropeller(center_->getContext());
    481         if (newPropeller != NULL && center_ != NULL)
     481        if (newPropeller != nullptr && center_ != nullptr)
    482482        {
    483483            newPropeller->addTemplate(center_->getPropellerTemplate());
     
    492492    {
    493493        JumpPropeller* newPropeller = new JumpPropeller(center_->getContext());
    494         if (newPropeller != NULL && center_ != NULL)
     494        if (newPropeller != nullptr && center_ != nullptr)
    495495        {
    496496            newPropeller->addTemplate(center_->getPropellerTemplate());
     
    505505    {
    506506        JumpBoots* newBoots = new JumpBoots(center_->getContext());
    507         if (newBoots != NULL && center_ != NULL)
     507        if (newBoots != nullptr && center_ != nullptr)
    508508        {
    509509            newBoots->addTemplate(center_->getBootsTemplate());
     
    518518    {
    519519        JumpBoots* newBoots = new JumpBoots(center_->getContext());
    520         if (newBoots != NULL && center_ != NULL)
     520        if (newBoots != nullptr && center_ != nullptr)
    521521        {
    522522            newBoots->addTemplate(center_->getBootsTemplate());
     
    531531    {
    532532        JumpShield* newShield = new JumpShield(center_->getContext());
    533         if (newShield != NULL && center_ != NULL)
     533        if (newShield != nullptr && center_ != nullptr)
    534534        {
    535535            newShield->addTemplate(center_->getShieldTemplate());
     
    544544    {
    545545        JumpShield* newShield = new JumpShield(center_->getContext());
    546         if (newShield != NULL && center_ != NULL)
     546        if (newShield != nullptr && center_ != nullptr)
    547547        {
    548548            newShield->addTemplate(center_->getShieldTemplate());
     
    557557    {
    558558        JumpEnemy* newEnemy = new JumpEnemy(center_->getContext());
    559         if (newEnemy != NULL && center_ != NULL)
     559        if (newEnemy != nullptr && center_ != nullptr)
    560560        {
    561561            switch (type)
     
    12701270    float Jump::getFuel() const
    12711271    {
    1272         if (this->figure_ != NULL)
    1273         {
    1274             if (this->figure_->rocketActive_ != NULL)
     1272        if (this->figure_ != nullptr)
     1273        {
     1274            if (this->figure_->rocketActive_ != nullptr)
    12751275            {
    12761276                return this->figure_->rocketActive_->getFuelState();
    12771277            }
    1278             else if (this->figure_->propellerActive_ != NULL)
     1278            else if (this->figure_->propellerActive_ != nullptr)
    12791279            {
    12801280                return this->figure_->propellerActive_->getFuelState();
    12811281            }
    1282             else if (this->figure_->shieldActive_ != NULL)
     1282            else if (this->figure_->shieldActive_ != nullptr)
    12831283            {
    12841284                return this->figure_->shieldActive_->getFuelState();
    12851285            }
    1286             else if (this->figure_->bootsActive_ != NULL)
     1286            else if (this->figure_->bootsActive_ != nullptr)
    12871287            {
    12881288                return this->figure_->bootsActive_->getFuelState();
  • code/branches/cpp11_v2/src/modules/jump/JumpBoots.cc

    r10733 r10765  
    7272        Vector3 rocketPosition = getWorldPosition();
    7373
    74         if (attachedToFigure_ == false && figure_ != NULL)
     74        if (attachedToFigure_ == false && figure_ != nullptr)
    7575        {
    7676            Vector3 figurePosition = figure_->getWorldPosition();
  • code/branches/cpp11_v2/src/modules/jump/JumpCenterpoint.cc

    r10733 r10765  
    8383    void JumpCenterpoint::checkGametype()
    8484    {
    85         if (getGametype() != NULL && this->getGametype()->isA(Class(Jump)))
     85        if (getGametype() != nullptr && this->getGametype()->isA(Class(Jump)))
    8686        {
    8787            Jump* jumpGametype = orxonox_cast<Jump*>(this->getGametype());
  • code/branches/cpp11_v2/src/modules/jump/JumpEnemy.cc

    r10733 r10765  
    119119        Vector3 enemyPosition = getPosition();
    120120
    121         if (figure_ != NULL)
     121        if (figure_ != nullptr)
    122122        {
    123123            Vector3 figurePosition = figure_->getPosition();
  • code/branches/cpp11_v2/src/modules/jump/JumpFigure.cc

    r10733 r10765  
    5151
    5252        // initialize variables
    53         leftHand_ = NULL;
    54         rightHand_ = NULL;
     53        leftHand_ = nullptr;
     54        rightHand_ = nullptr;
    5555        fieldHeight_ = 0;
    5656        fieldWidth_ = 0;
     
    7575        animateHands_ = false;
    7676        turnUp_ = false;
    77         rocketActive_ = NULL;
    78         propellerActive_ = NULL;
    79         bootsActive_ = NULL;
    80         shieldActive_ = NULL;
     77        rocketActive_ = nullptr;
     78        propellerActive_ = nullptr;
     79        bootsActive_ = nullptr;
     80        shieldActive_ = nullptr;
    8181        rocketSpeed_ = 0.0;
    8282        propellerSpeed_ = 0.0;
     
    111111            // Move up/down
    112112            Vector3 velocity = getVelocity();
    113             if (rocketActive_ != NULL)
     113            if (rocketActive_ != nullptr)
    114114            {
    115115                velocity.z = rocketSpeed_;
    116116            }
    117             else if (propellerActive_ != NULL)
     117            else if (propellerActive_ != nullptr)
    118118            {
    119119                velocity.z = propellerSpeed_;
     
    144144                }
    145145
    146                 if (leftHand_ != NULL)
     146                if (leftHand_ != nullptr)
    147147                {
    148148                    leftHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(-handAngle_));
    149149                }
    150                 if (rightHand_ != NULL)
     150                if (rightHand_ != nullptr)
    151151                {
    152152                    rightHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(handAngle_));
     
    212212        {
    213213            Vector3 velocity = getVelocity();
    214             if (bootsActive_ == NULL)
     214            if (bootsActive_ == nullptr)
    215215            {
    216216                velocity.z = 1.2f*jumpSpeed_;
     
    239239    void JumpFigure::CollisionWithEnemy(JumpEnemy* enemy)
    240240    {
    241         if (rocketActive_ == NULL && propellerActive_ == NULL && shieldActive_ == NULL)
     241        if (rocketActive_ == nullptr && propellerActive_ == nullptr && shieldActive_ == nullptr)
    242242        {
    243243            dead_ = true;
     
    247247    bool JumpFigure::StartRocket(JumpRocket* rocket)
    248248    {
    249         if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
     249        if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr)
    250250        {
    251251            attach(rocket);
     
    266266        detach(rocket);
    267267        rocket->destroy();
    268         rocketActive_ = NULL;
     268        rocketActive_ = nullptr;
    269269    }
    270270
    271271    bool JumpFigure::StartPropeller(JumpPropeller* propeller)
    272272    {
    273         if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
     273        if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr)
    274274        {
    275275            attach(propeller);
     
    290290        detach(propeller);
    291291        propeller->destroy();
    292         propellerActive_ = NULL;
     292        propellerActive_ = nullptr;
    293293    }
    294294
    295295    bool JumpFigure::StartBoots(JumpBoots* boots)
    296296    {
    297         if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
     297        if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr)
    298298        {
    299299            attach(boots);
     
    314314        detach(boots);
    315315        boots->destroy();
    316         bootsActive_ = NULL;
     316        bootsActive_ = nullptr;
    317317    }
    318318
     
    338338        detach(shield);
    339339        shield->destroy();
    340         shieldActive_ = NULL;
     340        shieldActive_ = nullptr;
    341341    }
    342342
  • code/branches/cpp11_v2/src/modules/jump/JumpPlatform.cc

    r10733 r10765  
    8686        Vector3 platformPosition = this->getPosition();
    8787
    88         if (figure_ != NULL)
     88        if (figure_ != nullptr)
    8989        {
    9090            Vector3 figurePosition = figure_->getPosition();
  • code/branches/cpp11_v2/src/modules/jump/JumpPlatformTimer.cc

    r10733 r10765  
    4747        RegisterObject(JumpPlatformTimer);
    4848
    49         particleSpawner_ = NULL;
     49        particleSpawner_ = nullptr;
    5050
    5151        setProperties(3.0);
     
    7171
    7272        time_ -= dt;
    73         if (time_ < effectStartTime_ && particleSpawner_ == NULL)
     73        if (time_ < effectStartTime_ && particleSpawner_ == nullptr)
    7474        {
    7575
  • code/branches/cpp11_v2/src/modules/jump/JumpPropeller.cc

    r10733 r10765  
    7272        Vector3 PropellerPosition = getWorldPosition();
    7373
    74         if (attachedToFigure_ == false && figure_ != NULL)
     74        if (attachedToFigure_ == false && figure_ != nullptr)
    7575        {
    7676            Vector3 figurePosition = figure_->getWorldPosition();
  • code/branches/cpp11_v2/src/modules/jump/JumpRocket.cc

    r10733 r10765  
    7272        Vector3 rocketPosition = getWorldPosition();
    7373
    74         if (attachedToFigure_ == false && figure_ != NULL)
     74        if (attachedToFigure_ == false && figure_ != nullptr)
    7575        {
    7676            Vector3 figurePosition = figure_->getWorldPosition();
  • code/branches/cpp11_v2/src/modules/jump/JumpScore.cc

    r10733 r10765  
    4848        RegisterObject(JumpScore);
    4949
    50         owner_ = NULL;
     50        owner_ = nullptr;
    5151        showScore_ = false;
    5252        showFuel_ = false;
     
    7373        SUPER(JumpScore, tick, dt);
    7474
    75         if (owner_ != NULL)
     75        if (owner_ != nullptr)
    7676        {
    7777            if (!owner_->hasEnded())
     
    7979                player_ = owner_->getPlayer();
    8080
    81                 if (player_ != NULL)
     81                if (player_ != nullptr)
    8282                {
    8383                    if (showScore_ == true)
     
    116116        SUPER(JumpScore, changedOwner);
    117117
    118         if (this->getOwner() != NULL && this->getOwner()->getGametype())
     118        if (this->getOwner() != nullptr && this->getOwner()->getGametype())
    119119        {
    120120            this->owner_ = orxonox_cast<Jump*>(this->getOwner()->getGametype());
     
    122122        else
    123123        {
    124             this->owner_ = NULL;
     124            this->owner_ = nullptr;
    125125        }
    126126    }
  • code/branches/cpp11_v2/src/modules/jump/JumpShield.cc

    r10733 r10765  
    7272        Vector3 shieldPosition = getWorldPosition();
    7373
    74         if (attachedToFigure_ == false && figure_ != NULL)
     74        if (attachedToFigure_ == false && figure_ != nullptr)
    7575        {
    7676            Vector3 figurePosition = figure_->getWorldPosition();
  • code/branches/cpp11_v2/src/modules/jump/JumpSpring.cc

    r10733 r10765  
    7777        Vector3 springPosition = getWorldPosition();
    7878
    79         if (figure_ != NULL)
     79        if (figure_ != nullptr)
    8080        {
    8181            Vector3 figurePosition = figure_->getWorldPosition();
Note: See TracChangeset for help on using the changeset viewer.