Changeset 10765 for code/branches/cpp11_v2/src/orxonox/worldentities
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- 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 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.