[Orxonox-commit 1080] r5801 - in code/branches/core5/src/orxonox: . controllers gametypes graphics infos items overlays pickup pickup/items weaponsystem worldentities worldentities/pawns
landauf at orxonox.net
landauf at orxonox.net
Sat Sep 26 22:25:03 CEST 2009
Author: landauf
Date: 2009-09-26 22:25:03 +0200 (Sat, 26 Sep 2009)
New Revision: 5801
Modified:
code/branches/core5/src/orxonox/PawnManager.cc
code/branches/core5/src/orxonox/PlayerManager.cc
code/branches/core5/src/orxonox/controllers/WaypointController.cc
code/branches/core5/src/orxonox/gametypes/Gametype.cc
code/branches/core5/src/orxonox/graphics/ParticleEmitter.cc
code/branches/core5/src/orxonox/graphics/ParticleSpawner.cc
code/branches/core5/src/orxonox/infos/HumanPlayer.cc
code/branches/core5/src/orxonox/infos/PlayerInfo.cc
code/branches/core5/src/orxonox/items/Engine.cc
code/branches/core5/src/orxonox/items/MultiStateEngine.cc
code/branches/core5/src/orxonox/overlays/OverlayGroup.cc
code/branches/core5/src/orxonox/pickup/DroppedItem.cc
code/branches/core5/src/orxonox/pickup/ModifierPickup.cc
code/branches/core5/src/orxonox/pickup/PickupSpawner.cc
code/branches/core5/src/orxonox/pickup/items/HealthImmediate.cc
code/branches/core5/src/orxonox/pickup/items/HealthUsable.cc
code/branches/core5/src/orxonox/pickup/items/Jump.cc
code/branches/core5/src/orxonox/weaponsystem/Weapon.cc
code/branches/core5/src/orxonox/weaponsystem/WeaponPack.cc
code/branches/core5/src/orxonox/weaponsystem/WeaponSystem.cc
code/branches/core5/src/orxonox/worldentities/BigExplosion.cc
code/branches/core5/src/orxonox/worldentities/ControllableEntity.cc
code/branches/core5/src/orxonox/worldentities/ExplosionChunk.cc
code/branches/core5/src/orxonox/worldentities/MovableEntity.cc
code/branches/core5/src/orxonox/worldentities/WorldEntity.cc
code/branches/core5/src/orxonox/worldentities/pawns/Pawn.cc
code/branches/core5/src/orxonox/worldentities/pawns/SpaceShip.cc
Log:
replaced delete with destroy() in orxonox
Modified: code/branches/core5/src/orxonox/PawnManager.cc
===================================================================
--- code/branches/core5/src/orxonox/PawnManager.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/PawnManager.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -56,12 +56,12 @@
for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++count)
{
if (!it->isAlive())
- delete (*(it++));
+ (it++)->destroy();
else
++it;
}
if (count == 0)
- delete this;
+ this->destroy();
}
}
Modified: code/branches/core5/src/orxonox/PlayerManager.cc
===================================================================
--- code/branches/core5/src/orxonox/PlayerManager.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/PlayerManager.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -84,7 +84,7 @@
// delete PlayerInfo instance
if (player)
- delete player;
+ player->destroy();
}
}
Modified: code/branches/core5/src/orxonox/controllers/WaypointController.cc
===================================================================
--- code/branches/core5/src/orxonox/controllers/WaypointController.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/controllers/WaypointController.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -49,7 +49,7 @@
if (this->isInitialized())
{
for (size_t i = 0; i < this->waypoints_.size(); ++i)
- delete this->waypoints_[i];
+ this->waypoints_[i]->destroy();
}
}
Modified: code/branches/core5/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/branches/core5/src/orxonox/gametypes/Gametype.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/gametypes/Gametype.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -418,7 +418,7 @@
{
if (it->getGametype() == this)
{
- delete (*(it++));
+ (it++)->destroy();
++i;
}
else
Modified: code/branches/core5/src/orxonox/graphics/ParticleEmitter.cc
===================================================================
--- code/branches/core5/src/orxonox/graphics/ParticleEmitter.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/graphics/ParticleEmitter.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -62,7 +62,7 @@
if (this->isInitialized() && this->particles_)
{
this->detachOgreObject(this->particles_->getParticleSystem());
- delete this->particles_;
+ this->particles_->destroy();
}
}
@@ -100,7 +100,7 @@
{
if (this->particles_)
{
- delete this->particles_;
+ this->particles_->destroy();
this->particles_ = 0;
}
Modified: code/branches/core5/src/orxonox/graphics/ParticleSpawner.cc
===================================================================
--- code/branches/core5/src/orxonox/graphics/ParticleSpawner.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/graphics/ParticleSpawner.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -125,6 +125,6 @@
void ParticleSpawner::destroyParticleSpawner()
{
- delete this;
+ this->destroy();
}
}
Modified: code/branches/core5/src/orxonox/infos/HumanPlayer.cc
===================================================================
--- code/branches/core5/src/orxonox/infos/HumanPlayer.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/infos/HumanPlayer.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -63,10 +63,10 @@
if (this->BaseObject::isInitialized())
{
if (this->humanHud_)
- delete this->humanHud_;
+ this->humanHud_->destroy();
if (this->gametypeHud_)
- delete this->gametypeHud_;
+ this->gametypeHud_->destroy();
}
}
@@ -169,7 +169,7 @@
{
if (this->humanHud_)
{
- delete this->humanHud_;
+ this->humanHud_->destroy();
this->humanHud_ = 0;
}
@@ -185,7 +185,7 @@
{
if (this->gametypeHud_)
{
- delete this->gametypeHud_;
+ this->gametypeHud_->destroy();
this->gametypeHud_ = 0;
}
Modified: code/branches/core5/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/branches/core5/src/orxonox/infos/PlayerInfo.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/infos/PlayerInfo.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -65,7 +65,7 @@
if (this->controller_)
{
- delete this->controller_;
+ this->controller_->destroy();
this->controller_ = 0;
}
@@ -130,7 +130,7 @@
{
if (this->controller_)
{
- delete this->controller_;
+ this->controller_->destroy();
this->controller_ = 0;
}
this->controller_ = this->defaultController_.fabricate(this);
Modified: code/branches/core5/src/orxonox/items/Engine.cc
===================================================================
--- code/branches/core5/src/orxonox/items/Engine.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/items/Engine.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -78,7 +78,7 @@
this->ship_->setEngine(0);
if (this->boostBlur_)
- delete this->boostBlur_;
+ this->boostBlur_->destroy();
if(this->sound_ != NULL)
delete this->sound_;
@@ -236,7 +236,7 @@
if (this->boostBlur_)
{
- delete this->boostBlur_;
+ this->boostBlur_->destroy();
this->boostBlur_ = 0;
}
Modified: code/branches/core5/src/orxonox/items/MultiStateEngine.cc
===================================================================
--- code/branches/core5/src/orxonox/items/MultiStateEngine.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/items/MultiStateEngine.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -59,13 +59,13 @@
{
// We have no ship, so the effects are not attached and won't be destroyed automatically
for (std::list<WorldEntity*>::const_iterator it = this->activeEffects_.begin(); it != this->activeEffects_.end(); ++it)
- delete (*it);
+ (*it)->destroy();
for (std::list<WorldEntity*>::const_iterator it = this->forwardEffects_.begin(); it != this->forwardEffects_.end(); ++it)
- delete (*it);
+ (*it)->destroy();
for (std::list<WorldEntity*>::const_iterator it = this->boostEffects_.begin(); it != this->boostEffects_.end(); ++it)
- delete (*it);
+ (*it)->destroy();
for (std::list<WorldEntity*>::const_iterator it = this->brakeEffects_.begin(); it != this->brakeEffects_.end(); ++it)
- delete (*it);
+ (*it)->destroy();
}
}
Modified: code/branches/core5/src/orxonox/overlays/OverlayGroup.cc
===================================================================
--- code/branches/core5/src/orxonox/overlays/OverlayGroup.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/overlays/OverlayGroup.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -60,7 +60,7 @@
OverlayGroup::~OverlayGroup()
{
for (std::set<OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
- delete (*it);
+ (*it)->destroy();
}
/**
Modified: code/branches/core5/src/orxonox/pickup/DroppedItem.cc
===================================================================
--- code/branches/core5/src/orxonox/pickup/DroppedItem.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/pickup/DroppedItem.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -68,7 +68,7 @@
if (this->item_->pickedUp(pawn))
{
COUT(3) << "DroppedItem '" << this->item_->getPickupIdentifier() << "' picked up." << std::endl;
- delete this;
+ this->destroy();
}
}
void DroppedItem::createTimer()
@@ -84,10 +84,10 @@
if (this->item_)
{
COUT(3) << "Delete DroppedItem with '" << this->item_->getPickupIdentifier() << "'" << std::endl;
- delete this->item_;
+ this->item_->destroy();
}
- delete this;
+ this->destroy();
}
DroppedItem* DroppedItem::createDefaultDrop(BaseItem* item, const Vector3& position, const ColourValue& flareColour, float timeToLive)
Modified: code/branches/core5/src/orxonox/pickup/ModifierPickup.cc
===================================================================
--- code/branches/core5/src/orxonox/pickup/ModifierPickup.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/pickup/ModifierPickup.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -138,7 +138,7 @@
if (this->timer_.getRemainingTime() > 0.0f)
this->timer_.stopTimer();
- delete this;
+ this->destroy();
return true;
}
Modified: code/branches/core5/src/orxonox/pickup/PickupSpawner.cc
===================================================================
--- code/branches/core5/src/orxonox/pickup/PickupSpawner.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/pickup/PickupSpawner.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -90,7 +90,7 @@
{
asItem->addTemplate(this->itemTemplate_);
PickupInventory::getImageForItem(asItem);
- delete newObject;
+ newObject->destroy();
}
// & load the GUI itself too, along with some empty windows
@@ -173,7 +173,7 @@
}
}
else
- delete newObject;
+ newObject->destroy();
}
}
}
Modified: code/branches/core5/src/orxonox/pickup/items/HealthImmediate.cc
===================================================================
--- code/branches/core5/src/orxonox/pickup/items/HealthImmediate.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/pickup/items/HealthImmediate.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -66,7 +66,7 @@
if (curH < maxH)
{
pawn->addHealth(this->recoveredHealth_);
- delete this;
+ this->destroy();
}
return (curH < maxH);
Modified: code/branches/core5/src/orxonox/pickup/items/HealthUsable.cc
===================================================================
--- code/branches/core5/src/orxonox/pickup/items/HealthUsable.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/pickup/items/HealthUsable.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -81,7 +81,7 @@
pawn->addHealth(this->recoveredHealth_);
this->removeFrom(pawn);
- delete this;
+ this->destroy();
}
}
/**
Modified: code/branches/core5/src/orxonox/pickup/items/Jump.cc
===================================================================
--- code/branches/core5/src/orxonox/pickup/items/Jump.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/pickup/items/Jump.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -83,7 +83,7 @@
if (this->jumpsAvailable_ <= 0)
{
this->removeFrom(pawn);
- delete this;
+ this->destroy();
}
}
/**
Modified: code/branches/core5/src/orxonox/weaponsystem/Weapon.cc
===================================================================
--- code/branches/core5/src/orxonox/weaponsystem/Weapon.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/weaponsystem/Weapon.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -61,7 +61,7 @@
this->weaponPack_->removeWeapon(this);
for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
- delete it->second;
+ it->second->destroy();
}
}
Modified: code/branches/core5/src/orxonox/weaponsystem/WeaponPack.cc
===================================================================
--- code/branches/core5/src/orxonox/weaponsystem/WeaponPack.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/weaponsystem/WeaponPack.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -53,10 +53,10 @@
this->weaponSystem_->removeWeaponPack(this);
while (!this->weapons_.empty())
- delete (*this->weapons_.begin());
+ (*this->weapons_.begin())->destroy();
for (std::set<DefaultWeaponmodeLink*>::iterator it = this->links_.begin(); it != this->links_.end(); )
- delete (*(it++));
+ (*(it++))->destroy();
}
}
Modified: code/branches/core5/src/orxonox/weaponsystem/WeaponSystem.cc
===================================================================
--- code/branches/core5/src/orxonox/weaponsystem/WeaponSystem.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/weaponsystem/WeaponSystem.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -61,16 +61,16 @@
this->pawn_->setWeaponSystem(0);
while (!this->weaponSets_.empty())
- delete (this->weaponSets_.begin()->second);
+ this->weaponSets_.begin()->second->destroy();
while (!this->weaponPacks_.empty())
- delete (*this->weaponPacks_.begin());
+ (*this->weaponPacks_.begin())->destroy();
while (!this->weaponSlots_.empty())
- delete (*this->weaponSlots_.begin());
+ (*this->weaponSlots_.begin())->destroy();
while (!this->munitions_.empty())
- { delete (this->munitions_.begin()->second); this->munitions_.erase(this->munitions_.begin()); }
+ { this->munitions_.begin()->second->destroy(); this->munitions_.erase(this->munitions_.begin()); }
}
}
Modified: code/branches/core5/src/orxonox/worldentities/BigExplosion.cc
===================================================================
--- code/branches/core5/src/orxonox/worldentities/BigExplosion.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/worldentities/BigExplosion.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -225,45 +225,45 @@
if (this->debrisFire1_)
{
this->debris1_->detachOgreObject(this->debrisFire1_->getParticleSystem());
- delete this->debrisFire1_;
+ this->debrisFire1_->destroy();
}
if (this->debrisSmoke1_)
{
this->debris1_->detachOgreObject(this->debrisSmoke1_->getParticleSystem());
- delete this->debrisSmoke1_;
+ this->debrisSmoke1_->destroy();
}
if (this->debrisFire2_)
{
this->debris2_->detachOgreObject(this->debrisFire2_->getParticleSystem());
- delete this->debrisFire2_;
+ this->debrisFire2_->destroy();
}
if (this->debrisSmoke2_)
{
this->debris2_->detachOgreObject(this->debrisSmoke2_->getParticleSystem());
- delete this->debrisSmoke2_;
+ this->debrisSmoke2_->destroy();
}
if (this->debrisFire3_)
{
this->debris3_->detachOgreObject(this->debrisFire3_->getParticleSystem());
- delete this->debrisFire3_;
+ this->debrisFire3_->destroy();
}
if (this->debrisSmoke3_)
{
this->debris3_->detachOgreObject(this->debrisSmoke3_->getParticleSystem());
- delete this->debrisSmoke3_;
+ this->debrisSmoke3_->destroy();
}
if (this->debrisFire4_)
{
this->debris4_->detachOgreObject(this->debrisFire4_->getParticleSystem());
- delete this->debrisFire4_;
+ this->debrisFire4_->destroy();
}
if (this->debrisSmoke4_)
{
this->debris4_->detachOgreObject(this->debrisSmoke4_->getParticleSystem());
- delete this->debrisSmoke4_;
+ this->debrisSmoke4_->destroy();
}
}
}
Modified: code/branches/core5/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/core5/src/orxonox/worldentities/ControllableEntity.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/worldentities/ControllableEntity.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -95,16 +95,16 @@
this->getPlayer()->stopControl();
if (this->xmlcontroller_)
- delete this->xmlcontroller_;
+ this->xmlcontroller_->destroy();
if (this->hud_)
- delete this->hud_;
+ this->hud_->destroy();
if (this->camera_)
- delete this->camera_;
+ this->camera_->destroy();
for (std::list<CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
- delete (*it);
+ (*it)->destroy();
if (this->getScene()->getSceneManager())
this->getScene()->getSceneManager()->destroySceneNode(this->cameraPositionRootNode_->getName());
@@ -258,7 +258,7 @@
this->changedPlayer();
if (this->bDestroyWhenPlayerLeft_)
- delete this;
+ this->destroy();
}
void ControllableEntity::networkcallback_changedplayerID()
@@ -302,13 +302,13 @@
if (this->camera_)
{
this->camera_->detachFromParent();
- delete this->camera_;
+ this->camera_->destroy();
this->camera_ = 0;
}
if (this->hud_)
{
- delete this->hud_;
+ this->hud_->destroy();
this->hud_ = 0;
}
}
Modified: code/branches/core5/src/orxonox/worldentities/ExplosionChunk.cc
===================================================================
--- code/branches/core5/src/orxonox/worldentities/ExplosionChunk.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/worldentities/ExplosionChunk.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -91,12 +91,12 @@
if (this->fire_)
{
this->detachOgreObject(this->fire_->getParticleSystem());
- delete this->fire_;
+ this->fire_->destroy();
}
if (this->smoke_)
{
this->detachOgreObject(this->smoke_->getParticleSystem());
- delete this->smoke_;
+ this->smoke_->destroy();
}
}
}
Modified: code/branches/core5/src/orxonox/worldentities/MovableEntity.cc
===================================================================
--- code/branches/core5/src/orxonox/worldentities/MovableEntity.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/worldentities/MovableEntity.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -60,7 +60,7 @@
{
if (this->isInitialized())
if (this->continuousResynchroTimer_)
- delete this->continuousResynchroTimer_;
+ this->continuousResynchroTimer_->destroy();
}
void MovableEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
Modified: code/branches/core5/src/orxonox/worldentities/WorldEntity.cc
===================================================================
--- code/branches/core5/src/orxonox/worldentities/WorldEntity.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/worldentities/WorldEntity.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -118,7 +118,7 @@
for (std::set<WorldEntity*>::const_iterator it = this->children_.begin(); it != this->children_.end(); )
{
if ((*it)->getDeleteWithParent())
- delete (*(it++));
+ (*(it++))->destroy();
else
{
(*it)->setPosition(this->getWorldPosition());
@@ -131,7 +131,7 @@
this->deactivatePhysics();
delete this->physicalBody_;
}
- delete this->collisionShape_;
+ this->collisionShape_->destroy();
this->node_->detachAllObjects();
this->node_->removeAllChildren();
Modified: code/branches/core5/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/core5/src/orxonox/worldentities/pawns/Pawn.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/worldentities/pawns/Pawn.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -96,7 +96,7 @@
it->destroyedPawn(this);
if (this->weaponSystem_)
- delete this->weaponSystem_;
+ this->weaponSystem_->destroy();
}
}
Modified: code/branches/core5/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/branches/core5/src/orxonox/worldentities/pawns/SpaceShip.cc 2009-09-26 20:21:26 UTC (rev 5800)
+++ code/branches/core5/src/orxonox/worldentities/pawns/SpaceShip.cc 2009-09-26 20:25:03 UTC (rev 5801)
@@ -74,7 +74,7 @@
SpaceShip::~SpaceShip()
{
if (this->isInitialized() && this->engine_)
- delete this->engine_;
+ this->engine_->destroy();
}
void SpaceShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -206,7 +206,7 @@
}
else
{
- delete object;
+ object->destroy();
}
}
}
More information about the Orxonox-commit
mailing list