Changeset 10765 for code/branches/cpp11_v2/src/orxonox
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (10 years ago)
- Location:
- code/branches/cpp11_v2/src/orxonox
- Files:
-
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/orxonox/CameraManager.cc
r10624 r10765 93 93 this->cameraList_.front()->setFocus(); 94 94 else 95 this->useCamera( NULL);95 this->useCamera(nullptr); 96 96 } 97 97 else -
code/branches/cpp11_v2/src/orxonox/LevelManager.cc
r10624 r10765 154 154 Get the currently active Level. 155 155 @return 156 Returns a pointer to the currently active level or NULLif there currently are no active Levels.156 Returns a pointer to the currently active level or nullptr if there currently are no active Levels. 157 157 */ 158 158 Level* LevelManager::getActiveLevel() … … 218 218 { 219 219 if(index >= this->availableLevels_.size()) 220 return NULL;220 return nullptr; 221 221 222 222 // If this index directly follows the last we can optimize a lot. … … 272 272 if (it->find("old/") != 0) 273 273 { 274 LevelInfoItem* info = NULL;274 LevelInfoItem* info = nullptr; 275 275 276 276 // Load the LevelInfo object from the level file. … … 286 286 Loader::getInstance().unload(&file); 287 287 288 if(info == NULL)288 if(info == nullptr) 289 289 { 290 290 // Create a default LevelInfoItem object that merely contains the name -
code/branches/cpp11_v2/src/orxonox/Scene.cc
r10727 r10765 66 66 this->bShadows_ = true; 67 67 this->bDebugDrawPhysics_ = false; 68 this->debugDrawer_ = NULL;68 this->debugDrawer_ = nullptr; 69 69 this->soundReferenceDistance_ = 20.0; 70 70 this->bIsUpdatingPhysics_ = false; -
code/branches/cpp11_v2/src/orxonox/chat/ChatInputHandler.cc
r10624 r10765 79 79 this->inpbuf = new InputBuffer(); 80 80 this->disp_offset = 0; 81 assert( this->inpbuf != NULL);81 assert( this->inpbuf != nullptr ); 82 82 83 83 /* generate chatbox ui and chatbox-inputonly ui */ -
code/branches/cpp11_v2/src/orxonox/collisionshapes/CollisionShape.h
r9667 r10765 181 181 182 182 btCollisionShape* collisionShape_; //!< The bullet collision shape of this CollisionShape. 183 CompoundCollisionShape* parent_; //!< The CompoundCollisionShape this CollisionShape belongs to, NULLif it doesn't belong to one.183 CompoundCollisionShape* parent_; //!< The CompoundCollisionShape this CollisionShape belongs to, nullptr if it doesn't belong to one. 184 184 unsigned int parentID_; //!< The objectID of the parent of this CollisionShape, which can either be a CompoundCollisionShape or a WorldEntity. 185 185 -
code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc
r10624 r10765 72 72 it->first->destroy(); 73 73 if (this->collisionShape_ == it->second) 74 this->collisionShape_ = NULL; // don't destroy it twice74 this->collisionShape_ = nullptr; // don't destroy it twice 75 75 } 76 76 77 77 delete this->compoundShape_; 78 78 if (this->collisionShape_ == this->compoundShape_) 79 this->collisionShape_ = NULL; // don't destroy it twice79 this->collisionShape_ = nullptr; // don't destroy it twice 80 80 } 81 81 } … … 96 96 void CompoundCollisionShape::attach(CollisionShape* shape) 97 97 { 98 // If either the input shape is NULLor we try to attach the CollisionShape to itself.98 // If either the input shape is nullptr or we try to attach the CollisionShape to itself. 99 99 if (!shape || static_cast<CollisionShape*>(this) == shape) 100 100 return; -
code/branches/cpp11_v2/src/orxonox/collisionshapes/WorldEntityCollisionShape.cc
r10624 r10765 43 43 RegisterObject(WorldEntityCollisionShape); 44 44 45 this->worldEntityOwner_ = NULL;45 this->worldEntityOwner_ = nullptr; 46 46 // suppress synchronisation 47 47 this->setSyncMode(ObjectDirection::None); -
code/branches/cpp11_v2/src/orxonox/controllers/AIController.cc
r9667 r10765 249 249 } 250 250 else 251 this->setPreviousMode();//If bot dies -> getControllableEntity == NULL-> get out of ROCKET mode251 this->setPreviousMode();//If bot dies -> getControllableEntity == nullptr -> get out of ROCKET mode 252 252 }//END_OF ROCKET MODE 253 253 -
code/branches/cpp11_v2/src/orxonox/controllers/ArtificialController.cc
r10733 r10765 56 56 this->currentWaypoint_ = 0; 57 57 this->setAccuracy(5); 58 this->defaultWaypoint_ = NULL;58 this->defaultWaypoint_ = nullptr; 59 59 this->mode_ = DEFAULT;//Vector-implementation: mode_.push_back(DEFAULT); 60 60 } … … 222 222 { 223 223 SpaceShip* ship = orxonox_cast<SpaceShip*>(this->getControllableEntity()); 224 if(ship == NULL) return;224 if(ship == nullptr) return; 225 225 if(ship->getBoostPower()*1.5f > ship->getInitialBoostPower() ) //upper limit ->boost 226 226 this->getControllableEntity()->boost(true); … … 258 258 void ArtificialController::updatePointsOfInterest(std::string name, float searchDistance) 259 259 { 260 WorldEntity* waypoint = NULL;260 WorldEntity* waypoint = nullptr; 261 261 for (WorldEntity* we : ObjectList<WorldEntity>()) 262 262 { -
code/branches/cpp11_v2/src/orxonox/controllers/ControllerDirector.cc
r10622 r10765 32 32 33 33 // Initialize member variables 34 this->player_ = NULL;35 this->entity_ = NULL;36 this->pTrigger_ = NULL;34 this->player_ = nullptr; 35 this->entity_ = nullptr; 36 this->pTrigger_ = nullptr; 37 37 this->context_ = context; 38 38 } … … 110 110 { 111 111 this->pTrigger_ = orxonox_cast<PlayerTrigger*>(trigger); 112 this->player_ = NULL;112 this->player_ = nullptr; 113 113 114 114 orxout(verbose) << "Preparation to take Control!" << endl; 115 115 116 116 // Check whether it is a player trigger and extract pawn from it 117 if(this->pTrigger_ != NULL)117 if(this->pTrigger_ != nullptr) 118 118 { 119 119 // Get the object which triggered the event. … … 121 121 122 122 // Check if there actually was a player returned. 123 if( this->player_ == NULL) return false;123 if( this->player_ == nullptr) return false; 124 124 } 125 125 else -
code/branches/cpp11_v2/src/orxonox/controllers/FormationController.cc
r10631 r10765 773 773 { 774 774 775 Pawn *humanPawn = NULL;776 NewHumanController *currentHumanController = NULL;775 Pawn *humanPawn = nullptr; 776 NewHumanController *currentHumanController = nullptr; 777 777 std::vector<FormationController*> allMasters; 778 778 … … 800 800 } 801 801 802 if((humanPawn != NULL) && (allMasters.size() != 0))802 if((humanPawn != nullptr) && (allMasters.size() != 0)) 803 803 { 804 804 float posHuman = humanPawn->getPosition().length(); … … 826 826 void FormationController::followInit(Pawn* pawn, const bool always, const int secondsToFollow) 827 827 { 828 if (pawn == NULL|| this->state_ != MASTER)828 if (pawn == nullptr || this->state_ != MASTER) 829 829 return; 830 830 this->specificMasterAction_ = FOLLOW; … … 844 844 { 845 845 846 Pawn *humanPawn = NULL;847 NewHumanController *currentHumanController = NULL;846 Pawn *humanPawn = nullptr; 847 NewHumanController *currentHumanController = nullptr; 848 848 849 849 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) … … 861 861 } 862 862 863 if((humanPawn != NULL))863 if((humanPawn != nullptr)) 864 864 this->followInit(humanPawn); 865 865 } -
code/branches/cpp11_v2/src/orxonox/controllers/HumanController.cc
r10624 r10765 321 321 return orxonox_cast<Pawn*>(HumanController::localController_s->getControllableEntity()); 322 322 else 323 return NULL;323 return nullptr; 324 324 } 325 325 -
code/branches/cpp11_v2/src/orxonox/controllers/NewHumanController.cc
r10631 r10765 62 62 NewHumanController::NewHumanController(Context* context) 63 63 : HumanController(context) 64 , crossHairOverlay_( NULL)65 , centerOverlay_( NULL)66 , damageOverlayTop_( NULL)67 , damageOverlayRight_( NULL)68 , damageOverlayBottom_( NULL)69 , damageOverlayLeft_( NULL)64 , crossHairOverlay_(nullptr) 65 , centerOverlay_(nullptr) 66 , damageOverlayTop_(nullptr) 67 , damageOverlayRight_(nullptr) 68 , damageOverlayBottom_(nullptr) 69 , damageOverlayLeft_(nullptr) 70 70 , damageOverlayTT_(0) 71 71 , damageOverlayTR_(0) 72 72 , damageOverlayTB_(0) 73 73 , damageOverlayTL_(0) 74 , arrowsOverlay1_( NULL)75 , arrowsOverlay2_( NULL)76 , arrowsOverlay3_( NULL)77 , arrowsOverlay4_( NULL)74 , arrowsOverlay1_(nullptr) 75 , arrowsOverlay2_(nullptr) 76 , arrowsOverlay3_(nullptr) 77 , arrowsOverlay4_(nullptr) 78 78 { 79 79 RegisterObject(NewHumanController); -
code/branches/cpp11_v2/src/orxonox/controllers/ScriptController.cc
r10622 r10765 64 64 /* Set default values for all variables */ 65 65 /* - pointers to zero */ 66 this->player_ = NULL;67 this->entity_ = NULL;66 this->player_ = nullptr; 67 this->entity_ = nullptr; 68 68 69 69 /* - times */ … … 138 138 139 139 } 140 return NULL;140 return nullptr; 141 141 } 142 142 -
code/branches/cpp11_v2/src/orxonox/gamestates/GSLevel.cc
r10624 r10765 156 156 { 157 157 ModifyConsoleCommand(__CC_changeGame_name).deactivate(); 158 ModifyConsoleCommand(__CC_reloadLevel_name).setObject( NULL).deactivate();158 ModifyConsoleCommand(__CC_reloadLevel_name).setObject(nullptr).deactivate(); 159 159 } 160 160 } -
code/branches/cpp11_v2/src/orxonox/gamestates/GSLevelMemento.h
r10281 r10765 48 48 protected: 49 49 /** 50 * Returns the state of this memento. Returns NULLif no state needed to persist.50 * Returns the state of this memento. Returns nullptr if no state needed to persist. 51 51 */ 52 52 virtual GSLevelMementoState* exportMementoState() = 0; -
code/branches/cpp11_v2/src/orxonox/gamestates/GSMainMenu.cc
r10624 r10765 73 73 74 74 // create an empty Scene 75 this->scene_ = new Scene( NULL);75 this->scene_ = new Scene(nullptr); 76 76 this->scene_->setSyncMode( 0x0 ); 77 77 // and a Camera -
code/branches/cpp11_v2/src/orxonox/gametypes/Gametype.cc
r10624 r10765 92 92 this->gtinfo_->destroy(); 93 93 94 ModifyConsoleCommand(__CC_addBots_name).setObject( NULL);95 ModifyConsoleCommand(__CC_killBots_name).setObject( NULL);94 ModifyConsoleCommand(__CC_addBots_name).setObject(nullptr); 95 ModifyConsoleCommand(__CC_killBots_name).setObject(nullptr); 96 96 } 97 97 } … … 337 337 { 338 338 // Fallback spawn point if there is no active one, choose a random one. 339 SpawnPoint* fallbackSpawnPoint = NULL;339 SpawnPoint* fallbackSpawnPoint = nullptr; 340 340 unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(this->spawnpoints_.size()))); 341 341 unsigned int index = 0; … … 346 346 fallbackSpawnPoint = (*it); 347 347 348 if (*it != NULL&& (*it)->isActive())348 if (*it != nullptr && (*it)->isActive()) 349 349 activeSpawnPoints.push_back(*it); 350 350 … … 552 552 } 553 553 554 return NULL;554 return nullptr; 555 555 } 556 556 … … 558 558 { 559 559 // find correct memento state 560 GametypeMementoState* state = NULL;560 GametypeMementoState* state = nullptr; 561 561 for (size_t i = 0; i < states.size(); ++i) 562 562 { … … 570 570 571 571 // find correct scene 572 Scene* scene = NULL;572 Scene* scene = nullptr; 573 573 for (ObjectList<Scene>::iterator it = ObjectList<Scene>::begin(); it != ObjectList<Scene>::end(); ++it) 574 574 { -
code/branches/cpp11_v2/src/orxonox/gametypes/TeamGametype.cc
r9941 r10765 75 75 void TeamGametype::playerEntered(PlayerInfo* player) 76 76 { 77 if(player == NULL) return; // catch null pointers77 if(player == nullptr) return; // catch null pointers 78 78 Gametype::playerEntered(player); 79 79 this->findAndSetTeam(player); … … 96 96 void TeamGametype::findAndSetTeam(PlayerInfo* player) 97 97 { 98 if(player == NULL) return; // catch null pointers98 if(player == nullptr) return; // catch null pointers 99 99 std::vector<unsigned int> playersperteam(this->teams_, 0); 100 100 … … 235 235 } 236 236 237 SpawnPoint* fallbackSpawnPoint = NULL;237 SpawnPoint* fallbackSpawnPoint = nullptr; 238 238 if (teamSpawnPoints.size() > 0) 239 239 { … … 328 328 void TeamGametype::setDefaultObjectColour(Pawn* pawn) 329 329 { 330 if(pawn == NULL)330 if(pawn == nullptr) 331 331 return; 332 332 … … 350 350 ArtificialController* artificial = orxonox_cast<ArtificialController*>(controller); 351 351 //get Teamnumber - get the data 352 if(artificial == NULL)352 if(artificial == nullptr) 353 353 return; 354 354 teamnumber= artificial->getTeam(); … … 360 360 void TeamGametype::colourPawn(Pawn* pawn, int teamNr) 361 361 {// catch: no-colouring-case and wrong input 362 if(teamNr < 0 || teamNr+1 > int(this->teamcolours_.size()) ||pawn == NULL) return;362 if(teamNr < 0 || teamNr+1 > int(this->teamcolours_.size()) ||pawn == nullptr) return; 363 363 pawn->setRadarObjectColour(this->teamcolours_[teamNr]); 364 364 -
code/branches/cpp11_v2/src/orxonox/graphics/Billboard.cc
r9667 r10765 139 139 { 140 140 Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet(); 141 if( bSet != NULL)141 if( bSet != nullptr ) 142 142 { 143 143 bSet->setBillboardType(bbt); … … 148 148 { 149 149 Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet(); 150 if( bSet != NULL)150 if( bSet != nullptr ) 151 151 { 152 152 bSet->setCommonDirection( vec ); … … 157 157 { 158 158 Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet(); 159 if( bSet != NULL)159 if( bSet != nullptr ) 160 160 { 161 161 bSet->setCommonUpVector( vec ); … … 166 166 { 167 167 Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet(); 168 if( bSet != NULL)168 if( bSet != nullptr ) 169 169 { 170 170 bSet->setDefaultDimensions(width, height); -
code/branches/cpp11_v2/src/orxonox/graphics/Model.cc
r10728 r10765 157 157 BaseObject* creatorPtr = this; 158 158 159 while(creatorPtr!= NULL&&orxonox_cast<WorldEntity*>(creatorPtr))159 while(creatorPtr!=nullptr&&orxonox_cast<WorldEntity*>(creatorPtr)) 160 160 { 161 161 scaleFactor *= getBiggestScale(((WorldEntity*) creatorPtr)->getScale3D()); -
code/branches/cpp11_v2/src/orxonox/infos/PlayerInfo.cc
r10624 r10765 181 181 182 182 RadarViewable* radarviewable = orxonox_cast<RadarViewable*>(entity); 183 if (radarviewable != NULL)183 if (radarviewable != nullptr) 184 184 radarviewable->setRadarName(this->getName()); 185 185 } … … 235 235 236 236 Controller* tmp =this->controllableEntity_->getController(); 237 if (tmp == NULL)238 { 239 orxout(verbose) << "PlayerInfo: pauseControl, Controller is NULL" << endl;237 if (tmp == nullptr) 238 { 239 orxout(verbose) << "PlayerInfo: pauseControl, Controller is nullptr " << endl; 240 240 return; 241 241 } 242 242 tmp->setActive(false); 243 //this->controllableEntity_->getController()->setControllableEntity( NULL);243 //this->controllableEntity_->getController()->setControllableEntity(nullptr); 244 244 this->controllableEntity_->setController(0); 245 245 } … … 249 249 ControllableEntity* entity = this->controllableEntity_; 250 250 251 assert(this->controllableEntity_ != NULL);251 assert(this->controllableEntity_ != nullptr); 252 252 if( !entity || this->previousControllableEntity_.size() == 0 ) 253 253 return; … … 260 260 do { 261 261 this->controllableEntity_ = this->previousControllableEntity_.back(); 262 } while(this->controllableEntity_ == NULL&& this->previousControllableEntity_.size() > 0);262 } while(this->controllableEntity_ == nullptr && this->previousControllableEntity_.size() > 0); 263 263 this->controllableEntityID_ = this->controllableEntity_->getObjectID(); 264 264 this->previousControllableEntity_.pop_back(); 265 265 266 if ( this->controllableEntity_ != NULL && this->controller_ != NULL)266 if ( this->controllableEntity_ != nullptr && this->controller_ != nullptr) 267 267 this->controller_->setControllableEntity(this->controllableEntity_); 268 268 269 269 // HACK-ish 270 if(this->controllableEntity_ != NULL&& this->isHumanPlayer())270 if(this->controllableEntity_ != nullptr && this->isHumanPlayer()) 271 271 this->controllableEntity_->createHud(); 272 272 -
code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.cc
r10624 r10765 127 127 { 128 128 if(!this->isTarget(pickup)) 129 return NULL;129 return nullptr; 130 130 131 131 if(pickup->isTarget(this)) // If the PickupCarrier itself is a target. 132 132 return this; 133 133 134 PickupCarrier* target = NULL;134 PickupCarrier* target = nullptr; 135 135 // Go recursively through all children to check whether they are the target. 136 136 std::vector<PickupCarrier*>* children = this->getCarrierChildren(); -
code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.h
r9667 r10765 59 59 But this structure has to be established first. 60 60 - <b>getCarrierChildren()</b> To this end a PickupCarrier needs to implement getCarrierChildren() which returns a list of its direct PickupCarrier children. If you need an example, have a look at @ref orxonox::Pawn "Pawn" and @ref orxonox::Engine "Engine". 61 - <b>getCarrierParent()</b> This is the method in the other direction. It returns the parent of this PickupCarrier, or NULLif the PickupCarrier is a root node in this hierarchy.61 - <b>getCarrierParent()</b> This is the method in the other direction. It returns the parent of this PickupCarrier, or nullptr if the PickupCarrier is a root node in this hierarchy. 62 62 63 63 @author -
code/branches/cpp11_v2/src/orxonox/interfaces/Pickupable.cc
r10624 r10765 56 56 RegisterObject(Pickupable); 57 57 58 this->carrier_ = NULL;58 this->carrier_ = nullptr; 59 59 60 60 this->beingDestroyed_ = false; … … 143 143 bool Pickupable::isTarget(const PickupCarrier* carrier) const 144 144 { 145 if(carrier == NULL)145 if(carrier == nullptr) 146 146 return false; 147 147 … … 210 210 bool Pickupable::pickup(PickupCarrier* carrier) 211 211 { 212 if(carrier == NULL || this->isPickedUp()) // If carrier is NULLor the Pickupable is already picked up.212 if(carrier == nullptr || this->isPickedUp()) // If carrier is nullptr or the Pickupable is already picked up. 213 213 return false; 214 214 … … 237 237 return false; 238 238 239 assert(this->getCarrier()); // The Carrier cannot be NULLat this point.239 assert(this->getCarrier()); // The Carrier cannot be nullptr at this point. 240 240 if(!this->getCarrier()->removePickup(this)) //TODO Shouldn't this be a little later? 241 241 orxout(internal_warning, context::pickups) << "Pickupable (&" << this << ", " << this->getIdentifier()->getName() << ") is being dropped, but it was not present in the PickupCarriers list of pickups." << endl; … … 249 249 created = this->createSpawner(); 250 250 251 this->setCarrier( NULL);251 this->setCarrier(nullptr); 252 252 253 253 if(!created && createSpawner) // If a PickupSpawner should have been created but wasn't. … … 301 301 orxout(verbose, context::pickups) << "Pickupable (&" << this << ") changed Carrier (& " << carrier << ")." << endl; 302 302 303 if(carrier != NULL&& tell)303 if(carrier != nullptr && tell) 304 304 { 305 305 if(!carrier->addPickup(this)) -
code/branches/cpp11_v2/src/orxonox/items/Engine.cc
r9667 r10765 155 155 void Engine::run(float dt) 156 156 { 157 if (this->ship_ == NULL)157 if (this->ship_ == nullptr) 158 158 { 159 159 if (this->shipID_ != 0) … … 161 161 this->networkcallback_shipID(); 162 162 163 if (this->ship_ == NULL)163 if (this->ship_ == nullptr) 164 164 return; 165 165 } -
code/branches/cpp11_v2/src/orxonox/items/Engine.h
r9667 r10765 67 67 /** 68 68 @brief Get the SpaceShip this Engine is mounted on. 69 @return Returns a pointer to the SpaceShip. NULLif it isn't mounted on any ship.69 @return Returns a pointer to the SpaceShip. nullptr if it isn't mounted on any ship. 70 70 */ 71 71 inline SpaceShip* getShip() const -
code/branches/cpp11_v2/src/orxonox/items/MultiStateEngine.cc
r9939 r10765 205 205 void MultiStateEngine::addEffectContainer(EffectContainer* effect) 206 206 { 207 if (effect == NULL)207 if (effect == nullptr) 208 208 return; 209 209 effect->setLuaState(this->lua_, 'f' + multi_cast<std::string>(this->effectContainers_.size())); … … 224 224 return (*it); 225 225 } 226 return NULL;226 return nullptr; 227 227 } 228 228 -
code/branches/cpp11_v2/src/orxonox/items/ShipPart.cc
r10624 r10765 50 50 51 51 ShipPart::ShipPart(Context* context) 52 : Item(context), parent_( NULL)52 : Item(context), parent_(nullptr) 53 53 { 54 54 RegisterObject(ShipPart); … … 122 122 void ShipPart::addEntity(StaticEntity* entity) 123 123 { 124 OrxAssert(entity != NULL, "The Entity cannot be NULL.");124 OrxAssert(entity != nullptr, "The Entity cannot be nullptr."); 125 125 this->entityList_.push_back(entity); 126 126 } … … 130 130 Get the i-th StaticEntity of the ShipPart. 131 131 @return 132 Returns a pointer to the i-the StaticEntity. NULLif there is no StaticEntity with that index.132 Returns a pointer to the i-the StaticEntity. nullptr if there is no StaticEntity with that index. 133 133 */ 134 134 StaticEntity* ShipPart::getEntity(unsigned int index) 135 135 { 136 136 if(this->entityList_.size() >= index) 137 return NULL;137 return nullptr; 138 138 else 139 139 return this->entityList_[index]; … … 164 164 void ShipPart::addDestructionEvent(PartDestructionEvent* event) 165 165 { 166 OrxAssert(event != NULL, "The PartDestructionEvent cannot be NULL.");166 OrxAssert(event != nullptr, "The PartDestructionEvent cannot be nullptr."); 167 167 event->setParent(this); 168 168 this->eventList_.push_back(event); … … 173 173 Get the i-th PartDestructionEvent of the ShipPart. 174 174 @return 175 Returns a pointer to the i-the PartDestructionEvent. NULLif there is no PartDestructionEvent with that index.175 Returns a pointer to the i-the PartDestructionEvent. nullptr if there is no PartDestructionEvent with that index. 176 176 */ 177 177 PartDestructionEvent* ShipPart::getDestructionEvent(unsigned int index) 178 178 { 179 179 if(this->eventList_.size() <= index) 180 return NULL;180 return nullptr; 181 181 else 182 182 return this->eventList_[index]; -
code/branches/cpp11_v2/src/orxonox/sound/AmbientSound.cc
r10624 r10765 93 93 const std::string& path = "ambient/" + mood + '/' + this->ambientSource_; 94 94 shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path); 95 if (fileInfo != NULL)95 if (fileInfo != nullptr) 96 96 { 97 97 orxout(user_info) << "Loading ambient sound " << path << "..." << endl; // TODO: make this output internal if we implement sound streaming -
code/branches/cpp11_v2/src/orxonox/sound/BaseSound.cc
r10624 r10765 66 66 this->stop(); 67 67 // Release buffer 68 if (this->soundBuffer_ != NULL)68 if (this->soundBuffer_ != nullptr) 69 69 { 70 70 assert(GameMode::playsSound()); … … 84 84 { 85 85 this->state_ = Playing; 86 if (GameMode::playsSound() && this->getSourceState() != AL_PLAYING && this->soundBuffer_ != NULL)86 if (GameMode::playsSound() && this->getSourceState() != AL_PLAYING && this->soundBuffer_ != nullptr) 87 87 { 88 88 if (!alIsSource(this->audioSource_)) … … 151 151 orxout(internal_warning, context::sound) << "Setting source parameters to 0 failed: " 152 152 << SoundManager::getALErrorString(error) << endl; 153 assert(this->soundBuffer_ != NULL);153 assert(this->soundBuffer_ != nullptr); 154 154 alSourcei(this->audioSource_, AL_BUFFER, this->soundBuffer_->getBuffer()); 155 155 if (ALuint error = alGetError()) … … 209 209 } 210 210 211 if (this->soundBuffer_ != NULL)211 if (this->soundBuffer_ != nullptr) 212 212 { 213 213 if (this->soundBuffer_->getFilename() == source) … … 233 233 // Get new sound buffer 234 234 this->soundBuffer_ = SoundManager::getInstance().getSoundBuffer(this->source_); 235 if (this->soundBuffer_ == NULL)235 if (this->soundBuffer_ == nullptr) 236 236 return; 237 237 -
code/branches/cpp11_v2/src/orxonox/sound/SoundBuffer.cc
r8858 r10765 45 45 { 46 46 if (this->filename_.empty()) 47 ThrowException(General, "SoundBuffer construction: fileInfo was NULL");47 ThrowException(General, "SoundBuffer construction: fileInfo was nullptr"); 48 48 49 49 // Get resource info 50 50 shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(filename); 51 if (fileInfo == NULL)51 if (fileInfo == nullptr) 52 52 { 53 53 orxout(internal_error, context::sound) << "Sound file '" << filename << "' not found" << endl; … … 138 138 vorbisCallbacks.seek_func = &seekVorbis; 139 139 vorbisCallbacks.tell_func = &tellVorbis; 140 vorbisCallbacks.close_func = NULL;140 vorbisCallbacks.close_func = nullptr; 141 141 142 142 OggVorbis_File vf; 143 int ret = ov_open_callbacks(dataStream.get(), &vf, NULL, 0, vorbisCallbacks);143 int ret = ov_open_callbacks(dataStream.get(), &vf, nullptr, 0, vorbisCallbacks); 144 144 if (ret < 0) 145 145 { -
code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc
r10624 r10765 83 83 ThrowException(InitialisationAborted, "Sound: Not loading at all"); 84 84 #if !defined(ORXONOX_PLATFORM_APPLE) 85 if (!alutInitWithoutContext( NULL, NULL))85 if (!alutInitWithoutContext(nullptr, nullptr)) 86 86 ThrowException(InitialisationFailed, "Sound Error: ALUT initialisation failed: " << alutGetErrorString(alutGetError())); 87 87 Loki::ScopeGuard alutExitGuard = Loki::MakeGuard(&alutExit); … … 90 90 /* 91 91 // Get list of available sound devices and display them 92 const char* devices = alcGetString( NULL, ALC_DEVICE_SPECIFIER);92 const char* devices = alcGetString(nullptr, ALC_DEVICE_SPECIFIER); 93 93 char* device = new char[strlen(devices)+1]; 94 94 strcpy(device, devices); … … 110 110 this->device_ = alcOpenDevice(renderDevice.c_str()); 111 111 */ 112 this->device_ = alcOpenDevice( NULL);113 if (this->device_ == NULL)112 this->device_ = alcOpenDevice(nullptr); 113 if (this->device_ == nullptr) 114 114 ThrowException(InitialisationFailed, "Sound Error: Could not open sound device."); 115 115 Loki::ScopeGuard closeDeviceGuard = Loki::MakeGuard(&alcCloseDevice, this->device_); 116 116 117 117 // Create sound context and make it the currently used one 118 this->context_ = alcCreateContext(this->device_, NULL);119 if (this->context_ == NULL)118 this->context_ = alcCreateContext(this->device_, nullptr); 119 if (this->context_ == nullptr) 120 120 ThrowException(InitialisationFailed, "Sound Error: Could not create ALC context"); 121 121 Loki::ScopeGuard desroyContextGuard = Loki::MakeGuard(&alcDestroyContext, this->context_); … … 189 189 190 190 // Relieve context to destroy it 191 if (!alcMakeContextCurrent( NULL))191 if (!alcMakeContextCurrent(nullptr)) 192 192 orxout(internal_error, context::sound) << "Could not unset ALC context" << endl; 193 193 alcDestroyContext(this->context_); … … 350 350 void SoundManager::registerAmbientSound(AmbientSound* newAmbient) 351 351 { 352 if (newAmbient != NULL&& !this->bDestructorCalled_)352 if (newAmbient != nullptr && !this->bDestructorCalled_) 353 353 { 354 354 for (AmbientList::const_iterator it = this->ambientSounds_.begin(); it != this->ambientSounds_.end(); ++it) … … 373 373 void SoundManager::unregisterAmbientSound(AmbientSound* oldAmbient) 374 374 { 375 if (oldAmbient == NULL|| ambientSounds_.empty() || this->bDestructorCalled_)375 if (oldAmbient == nullptr || ambientSounds_.empty() || this->bDestructorCalled_) 376 376 return; 377 377 … … 405 405 void SoundManager::pauseAmbientSound(AmbientSound* ambient) 406 406 { 407 if (ambient != NULL)407 if (ambient != nullptr) 408 408 { 409 409 for (AmbientList::iterator it = this->ambientSounds_.begin(); it != this->ambientSounds_.end(); ++it) -
code/branches/cpp11_v2/src/orxonox/sound/SoundStreamer.cc
r8858 r10765 45 45 vorbisCallbacks.seek_func = &seekVorbis; 46 46 vorbisCallbacks.tell_func = &tellVorbis; 47 vorbisCallbacks.close_func = NULL;47 vorbisCallbacks.close_func = nullptr; 48 48 49 49 OggVorbis_File vf; 50 int ret = ov_open_callbacks(dataStream.get(), &vf, NULL, 0, vorbisCallbacks);50 int ret = ov_open_callbacks(dataStream.get(), &vf, nullptr, 0, vorbisCallbacks); 51 51 if (ret < 0) 52 52 { -
code/branches/cpp11_v2/src/orxonox/worldentities/ControllableEntity.cc
r10624 r10765 62 62 this->client_overwrite_ = 0; 63 63 this->player_ = 0; 64 this->formerPlayer_ = NULL;64 this->formerPlayer_ = nullptr; 65 65 this->playerID_ = OBJECTID_UNKNOWN; 66 66 this->hud_ = 0; … … 194 194 bool ControllableEntity::setCameraPosition(unsigned int index) 195 195 { 196 if(this->camera_ != NULL&& this->cameraPositions_.size() > 0)196 if(this->camera_ != nullptr && this->cameraPositions_.size() > 0) 197 197 { 198 198 if(index >= this->cameraPositions_.size()) … … 350 350 this->bHasLocalController_ = player->isLocalPlayer(); 351 351 this->bHasHumanController_ = player->isHumanPlayer(); 352 if(controller_ != NULL)352 if(controller_ != nullptr) 353 353 this->team_ = controller_->getTeam(); // forward controller team number 354 354 … … 434 434 void ControllableEntity::destroyHud(void) 435 435 { 436 if (this->hud_ != NULL)436 if (this->hud_ != nullptr) 437 437 { 438 438 this->hud_->destroy(); 439 this->hud_ = NULL;439 this->hud_ = nullptr; 440 440 } 441 441 } -
code/branches/cpp11_v2/src/orxonox/worldentities/EffectContainer.cc
r9667 r10765 44 44 EffectContainer::EffectContainer(Context* context) 45 45 : BaseObject(context) 46 , lua_( NULL)46 , lua_(nullptr) 47 47 { 48 48 RegisterObject(EffectContainer); … … 92 92 if (i == index) 93 93 return (*it); 94 return NULL;94 return nullptr; 95 95 } 96 96 -
code/branches/cpp11_v2/src/orxonox/worldentities/WorldEntity.cc
r10624 r10765 563 563 void WorldEntity::detachOgreObject(Ogre::MovableObject* object) 564 564 { 565 object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>( NULL)));565 object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(nullptr))); 566 566 this->node_->detachObject(object); 567 567 } … … 660 660 { 661 661 // If physics is enabled scale the attached CollisionShape. 662 /*if (this->hasPhysics() && this->collisionShape_ != NULL)662 /*if (this->hasPhysics() && this->collisionShape_ != nullptr) 663 663 { 664 664 this->collisionShape_->setScale3D(scale); -
code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
r10624 r10765 94 94 for (unsigned int i=0; i < this->getAttachedObjects().size(); i++) 95 95 { 96 if (this->getAttachedObject(i) == NULL)96 if (this->getAttachedObject(i) == nullptr) 97 97 { 98 98 break; … … 151 151 return it->second; 152 152 } 153 return NULL;153 return nullptr; 154 154 } 155 155 … … 160 160 void ModularSpaceShip::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) 161 161 { 162 if (cs != NULL && this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != NULL)162 if (cs != nullptr && this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != nullptr) 163 163 this->getPartOfEntity((StaticEntity*)(cs->getUserPointer()))->handleHit(damage, healthdamage, shielddamage, originator); 164 164 else … … 212 212 void ModularSpaceShip::addShipPart(ShipPart* part) 213 213 { 214 OrxAssert(part != NULL, "The ShipPart cannot be NULL.");214 OrxAssert(part != nullptr, "The ShipPart cannot be nullptr."); 215 215 this->partList_.push_back(part); 216 216 part->setParent(this); … … 222 222 Get the i-th ShipPart of the SpaceShip. 223 223 @return 224 Returns a pointer to the i-the ShipPart. NULLif 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. 225 225 */ 226 226 ShipPart* ModularSpaceShip::getShipPart(unsigned int index) 227 227 { 228 228 if(this->partList_.size() <= index) 229 return NULL;229 return nullptr; 230 230 else 231 231 return this->partList_[index]; … … 238 238 The name of the ShipPart to be returned. 239 239 @return 240 Pointer to the ShipPart with the given name, or NULLif not found.240 Pointer to the ShipPart with the given name, or nullptr if not found. 241 241 */ 242 242 ShipPart* ModularSpaceShip::getShipPartByName(std::string name) … … 250 250 } 251 251 orxout(internal_warning) << "Couldn't find ShipPart with name \"" << name << "\"." << endl; 252 return NULL;252 return nullptr; 253 253 } 254 254 -
code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.h
r10262 r10765 109 109 ShipPart* getPartOfEntity(StaticEntity* entity) const; 110 110 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); 112 112 113 113 static void killShipPartStatic(std::string name); -
code/branches/cpp11_v2/src/orxonox/worldentities/pawns/Pawn.h
r10437 r10765 208 208 209 209 //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); 211 211 212 212 bool bAlive_; … … 215 215 { return new std::vector<PickupCarrier*>(); } 216 216 virtual PickupCarrier* getCarrierParent(void) const 217 { return NULL; }217 { return nullptr; } 218 218 219 219 -
code/branches/cpp11_v2/src/orxonox/worldentities/pawns/SpaceShip.cc
r10216 r10765 48 48 RegisterClass(SpaceShip); 49 49 50 SpaceShip::SpaceShip(Context* context) : Pawn(context), boostBlur_( NULL)50 SpaceShip::SpaceShip(Context* context) : Pawn(context), boostBlur_(nullptr) 51 51 { 52 52 RegisterObject(SpaceShip); … … 196 196 if(this->bEnableMotionBlur_) 197 197 { 198 if (this->boostBlur_ == NULL&& this->hasLocalController() && this->hasHumanController())198 if (this->boostBlur_ == nullptr && this->hasLocalController() && this->hasHumanController()) 199 199 { 200 200 this->boostBlur_ = new Shader(this->getScene()->getSceneManager()); … … 305 305 void SpaceShip::addEngine(orxonox::Engine* engine) 306 306 { 307 OrxAssert(engine != NULL, "The engine cannot be NULL.");307 OrxAssert(engine != nullptr, "The engine cannot be nullptr."); 308 308 this->engineList_.push_back(engine); 309 309 engine->addToSpaceShip(this); … … 330 330 Get the i-th Engine of the SpaceShip. 331 331 @return 332 Returns a pointer to the i-the Engine. NULLif 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. 333 333 */ 334 334 Engine* SpaceShip::getEngine(unsigned int i) 335 335 { 336 336 if(this->engineList_.size() >= i) 337 return NULL;337 return nullptr; 338 338 else 339 339 return this->engineList_[i]; … … 346 346 The name of the engine to be returned. 347 347 @return 348 Pointer to the engine with the given name, or NULLif not found.348 Pointer to the engine with the given name, or nullptr if not found. 349 349 */ 350 350 Engine* SpaceShip::getEngineByName(const std::string& name) … … 355 355 356 356 orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl; 357 return NULL;357 return nullptr; 358 358 } 359 359 … … 465 465 void SpaceShip::changedEnableMotionBlur() 466 466 { 467 if (!this->bEnableMotionBlur_ && this->boostBlur_ != NULL)467 if (!this->bEnableMotionBlur_ && this->boostBlur_ != nullptr) 468 468 { 469 469 delete this->boostBlur_; 470 this->boostBlur_ = NULL;470 this->boostBlur_ = nullptr; 471 471 } 472 472 } … … 510 510 { 511 511 Camera* camera = CameraManager::getInstance().getActiveCamera(); 512 if(camera != NULL)512 if(camera != nullptr) 513 513 { 514 514 this->cameraOriginalPosition_ = camera->getPosition();
Note: See TracChangeset
for help on using the changeset viewer.