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/gametypes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/modules/gametypes/RaceCheckPoint.cc

    r9973 r10765  
    125125            }
    126126        }
    127         return NULL;
     127        return nullptr;
    128128    }
    129129
  • code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc

    r10318 r10765  
    9898                    RaceCheckPoint* point2 = findCheckpoint((*numb));
    9999
    100                     //if(point2 != NULL)
     100                    //if(point2 != nullptr)
    101101                    //placeVirtualCheckpoints((*it), point2);
    102102                }
     
    126126        staticRacePoints_ = findStaticCheckpoints(nextRaceCheckpoint_, checkpoints);
    127127        // initialisation of currentRaceCheckpoint_
    128         currentRaceCheckpoint_ = NULL;
     128        currentRaceCheckpoint_ = nullptr;
    129129
    130130        int i;
    131         for (i = -2; findCheckpoint(i) != NULL; i--)
     131        for (i = -2; findCheckpoint(i) != nullptr; i--)
    132132        {
    133133            continue;
     
    194194                    continue;
    195195                }
    196                 if (findCheckpoint(*it) == NULL)
     196                if (findCheckpoint(*it) == nullptr)
    197197                    orxout(internal_warning) << "Problematic Point: " << (*it) << endl;
    198198                else
     
    209209    float SpaceRaceController::distanceSpaceshipToCheckPoint(RaceCheckPoint* CheckPoint)
    210210    {
    211         if (this->getControllableEntity() != NULL)
     211        if (this->getControllableEntity() != nullptr)
    212212        {
    213213            return (CheckPoint->getPosition()- this->getControllableEntity()->getPosition()).length();
     
    223223    {
    224224        float minDistance = 0;
    225         RaceCheckPoint* minNextRaceCheckPoint = NULL;
     225        RaceCheckPoint* minNextRaceCheckPoint = nullptr;
    226226
    227227        // find the next checkpoint with the minimal distance
     
    231231            float distance = recCalculateDistance(nextRaceCheckPoint, this->getControllableEntity()->getPosition());
    232232
    233             if (distance < minDistance || minNextRaceCheckPoint == NULL)
     233            if (distance < minDistance || minNextRaceCheckPoint == nullptr)
    234234            {
    235235                minDistance = distance;
     
    271271    RaceCheckPoint* SpaceRaceController::adjustNextPoint()
    272272    {
    273         if (currentRaceCheckpoint_ == NULL) // no Adjust possible
     273        if (currentRaceCheckpoint_ == nullptr) // no Adjust possible
    274274
    275275        {
     
    292292            if (this->checkpoints_[i]->getCheckpointIndex() == index)
    293293                return this->checkpoints_[i];
    294         return NULL;
     294        return nullptr;
    295295    }
    296296
     
    347347    void SpaceRaceController::tick(float dt)
    348348    {
    349         if (this->getControllableEntity() == NULL || this->getControllableEntity()->getPlayer() == NULL )
     349        if (this->getControllableEntity() == nullptr || this->getControllableEntity()->getPlayer() == nullptr )
    350350        {
    351351            //orxout()<< this->getControllableEntity() << " in tick"<<endl;
     
    419419            {
    420420                btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape();
    421                 if(currentShape == NULL)
     421                if(currentShape == nullptr)
    422422                continue;
    423423
     
    447447            {
    448448                btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape();
    449                 if(currentShape == NULL)
     449                if(currentShape == nullptr)
    450450                continue;
    451451
     
    491491        {
    492492
    493             if (dynamic_cast<RaceCheckPoint*>(*it) != NULL)
     493            if (dynamic_cast<RaceCheckPoint*>(*it) != nullptr)
    494494            {
    495495                continue;
     
    537537        //                    btVector3 positionObject;
    538538        //                    btScalar radiusObject;
    539         //                    if((*it)==NULL)
     539        //                    if((*it)==nullptr)
    540540        //                    {   orxout()<<"Problempoint 1.1"<<endl; continue;}
    541541        //                    //TODO: Probably it points on a wrong object
    542542        //                    for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++)
    543543        //                    {
    544         //                        if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==NULL)
     544        //                        if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==nullptr)
    545545        //                        {    continue;}
    546546        //
     
    570570        //                        btVector3 positionObject;
    571571        //                        btScalar radiusObject;
    572         //                        if((*it)==NULL)
     572        //                        if((*it)==nullptr)
    573573        //                        {   orxout()<<"Problempoint 1"<<endl; continue;}
    574574        //                        for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++)
    575575        //                        {
    576         //                            if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==NULL)
     576        //                            if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==nullptr)
    577577        //                            {   orxout()<<"Problempoint 2.2"<<endl; continue;}
    578578        //                            (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()->getBoundingSphere(positionObject,radiusObject);
  • code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceManager.cc

    r10624 r10765  
    7171        this->players_ = this->race_->getPlayers();
    7272
    73         if (this->checkpoints_[0] != NULL && !this->firstcheckpointvisible_)
     73        if (this->checkpoints_[0] != nullptr && !this->firstcheckpointvisible_)
    7474        {
    7575            this->checkpoints_[0]->setRadarVisibility(true);
     
    121121    bool SpaceRaceManager::reachedValidCheckpoint(RaceCheckPoint* oldCheckpoint, RaceCheckPoint* newCheckpoint, PlayerInfo* player) const
    122122    {
    123         if (oldCheckpoint != NULL)
     123        if (oldCheckpoint != nullptr)
    124124        {
    125125            // the player already visited an old checkpoint; see which checkpoints are possible now
Note: See TracChangeset for help on using the changeset viewer.