Changeset 5929 for code/trunk/src/orxonox/worldentities
- Timestamp:
- Oct 12, 2009, 8:20:07 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core5 (added) merged: 5768-5769,5772,5775-5780,5783-5785,5791-5792,5795-5807,5809-5814,5816-5832,5836-5839,5842-5853,5855-5899,5904-5922,5924-5928
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/worldentities/BigExplosion.cc
r5781 r5929 90 90 this->setVelocity(velocity); 91 91 92 this->destroyTimer_.setTimer(rnd(2, 4), false, this, createExecutor(createFunctor(&BigExplosion::stop)));92 this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this))); 93 93 } 94 94 this->registerVariables(); … … 226 226 { 227 227 this->debris1_->detachOgreObject(this->debrisFire1_->getParticleSystem()); 228 delete this->debrisFire1_;228 this->debrisFire1_->destroy(); 229 229 } 230 230 if (this->debrisSmoke1_) 231 231 { 232 232 this->debris1_->detachOgreObject(this->debrisSmoke1_->getParticleSystem()); 233 delete this->debrisSmoke1_;233 this->debrisSmoke1_->destroy(); 234 234 } 235 235 … … 237 237 { 238 238 this->debris2_->detachOgreObject(this->debrisFire2_->getParticleSystem()); 239 delete this->debrisFire2_;239 this->debrisFire2_->destroy(); 240 240 } 241 241 if (this->debrisSmoke2_) 242 242 { 243 243 this->debris2_->detachOgreObject(this->debrisSmoke2_->getParticleSystem()); 244 delete this->debrisSmoke2_;244 this->debrisSmoke2_->destroy(); 245 245 } 246 246 … … 248 248 { 249 249 this->debris3_->detachOgreObject(this->debrisFire3_->getParticleSystem()); 250 delete this->debrisFire3_;250 this->debrisFire3_->destroy(); 251 251 } 252 252 if (this->debrisSmoke3_) 253 253 { 254 254 this->debris3_->detachOgreObject(this->debrisSmoke3_->getParticleSystem()); 255 delete this->debrisSmoke3_;255 this->debrisSmoke3_->destroy(); 256 256 } 257 257 … … 259 259 { 260 260 this->debris4_->detachOgreObject(this->debrisFire4_->getParticleSystem()); 261 delete this->debrisFire4_;261 this->debrisFire4_->destroy(); 262 262 } 263 263 if (this->debrisSmoke4_) 264 264 { 265 265 this->debris4_->detachOgreObject(this->debrisSmoke4_->getParticleSystem()); 266 delete this->debrisSmoke4_;266 this->debrisSmoke4_->destroy(); 267 267 } 268 268 } … … 329 329 { 330 330 this->bStop_ = true; 331 this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&BigExplosion::destroy))); 332 } 333 } 334 335 void BigExplosion::destroy() 336 { 337 delete this; 331 this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&BigExplosion::destroy, this))); 332 } 338 333 } 339 334 -
code/trunk/src/orxonox/worldentities/BigExplosion.h
r5781 r5929 57 57 void checkStop(); 58 58 void stop(); 59 void destroy();60 59 void init(); 61 60 void initZero(); … … 98 97 ParticleInterface* explosionFire_; 99 98 100 LODParticle::Value 101 Timer <BigExplosion>destroyTimer_;99 LODParticle::Value LOD_; 100 Timer destroyTimer_; 102 101 }; 103 102 } -
code/trunk/src/orxonox/worldentities/CameraPosition.cc
r5781 r5929 46 46 this->bRenderCamera_ = false; 47 47 48 this->set ObjectMode(0x0);48 this->setSyncMode(0x0); 49 49 } 50 50 -
code/trunk/src/orxonox/worldentities/ControllableEntity.cc
r5781 r5929 96 96 97 97 if (this->xmlcontroller_) 98 delete this->xmlcontroller_;98 this->xmlcontroller_->destroy(); 99 99 100 100 if (this->hud_) 101 delete this->hud_;101 this->hud_->destroy(); 102 102 103 103 if (this->camera_) 104 delete this->camera_;105 106 for (std::list< CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)107 delete (*it);104 this->camera_->destroy(); 105 106 for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 107 (*it)->destroy(); 108 108 109 109 if (this->getScene()->getSceneManager()) … … 153 153 { 154 154 unsigned int i = 0; 155 for (std::list< CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)155 for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 156 156 { 157 157 if (i == index) … … 172 172 else if (this->cameraPositions_.size() > 0) 173 173 { 174 for (std::list< CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)174 for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 175 175 { 176 176 if ((*it) == this->camera_->getParent()) … … 238 238 { 239 239 this->client_overwrite_ = this->server_overwrite_; 240 this->set ObjectMode(ObjectDirection::Bidirectional);240 this->setSyncMode(ObjectDirection::Bidirectional); 241 241 } 242 242 } … … 254 254 this->bHasLocalController_ = false; 255 255 this->bHasHumanController_ = false; 256 this->set ObjectMode(ObjectDirection::ToClient);256 this->setSyncMode(ObjectDirection::ToClient); 257 257 258 258 this->changedPlayer(); 259 259 260 260 if (this->bDestroyWhenPlayerLeft_) 261 delete this;261 this->destroy(); 262 262 } 263 263 … … 275 275 void ControllableEntity::startLocalHumanControl() 276 276 { 277 if (!this->camera_ )277 if (!this->camera_ && GameMode::showsGraphics()) 278 278 { 279 279 this->camera_ = new Camera(this); … … 287 287 } 288 288 289 if (!this->hud_ )289 if (!this->hud_ && GameMode::showsGraphics()) 290 290 { 291 291 if (this->hudtemplate_ != "") … … 303 303 { 304 304 this->camera_->detachFromParent(); 305 delete this->camera_;305 this->camera_->destroy(); 306 306 this->camera_ = 0; 307 307 } … … 309 309 if (this->hud_) 310 310 { 311 delete this->hud_;311 this->hud_->destroy(); 312 312 this->hud_ = 0; 313 313 } … … 333 333 if (parent) 334 334 { 335 for (std::list< CameraPosition*>::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)335 for (std::list<SmartPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 336 336 if ((*it)->getIsAbsolute()) 337 337 parent->attach((*it)); -
code/trunk/src/orxonox/worldentities/ControllableEntity.h
r5781 r5929 104 104 void addCameraPosition(CameraPosition* position); 105 105 CameraPosition* getCameraPosition(unsigned int index) const; 106 inline const std::list< CameraPosition*>& getCameraPositions() const106 inline const std::list<SmartPtr<CameraPosition> >& getCameraPositions() const 107 107 { return this->cameraPositions_; } 108 108 … … 198 198 float mouseLookSpeed_; 199 199 Ogre::SceneNode* cameraPositionRootNode_; 200 std::list< CameraPosition*> cameraPositions_;200 std::list<SmartPtr<CameraPosition> > cameraPositions_; 201 201 std::string cameraPositionTemplate_; 202 202 Controller* xmlcontroller_; -
code/trunk/src/orxonox/worldentities/ExplosionChunk.cc
r5781 r5929 79 79 this->setVelocity(velocity); 80 80 81 this->destroyTimer_.setTimer(rnd(1, 2), false, this, createExecutor(createFunctor(&ExplosionChunk::stop)));81 this->destroyTimer_.setTimer(rnd(1, 2), false, createExecutor(createFunctor(&ExplosionChunk::stop, this))); 82 82 } 83 83 … … 92 92 { 93 93 this->detachOgreObject(this->fire_->getParticleSystem()); 94 delete this->fire_;94 this->fire_->destroy(); 95 95 } 96 96 if (this->smoke_) 97 97 { 98 98 this->detachOgreObject(this->smoke_->getParticleSystem()); 99 delete this->smoke_;99 this->smoke_->destroy(); 100 100 } 101 101 } … … 132 132 { 133 133 this->bStop_ = true; 134 this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&ExplosionChunk::destroy)));134 this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&ExplosionChunk::destroy, this))); 135 135 } 136 }137 138 void ExplosionChunk::destroy()139 {140 delete this;141 136 } 142 137 -
code/trunk/src/orxonox/worldentities/ExplosionChunk.h
r5781 r5929 55 55 void checkStop(); 56 56 void stop(); 57 void destroy();58 57 59 58 bool bStop_; 60 59 ParticleInterface* fire_; 61 60 ParticleInterface* smoke_; 62 LODParticle::Value 63 Timer <ExplosionChunk>destroyTimer_;61 LODParticle::Value LOD_; 62 Timer destroyTimer_; 64 63 }; 65 64 } -
code/trunk/src/orxonox/worldentities/MovableEntity.cc
r5781 r5929 61 61 if (this->isInitialized()) 62 62 if (this->continuousResynchroTimer_) 63 delete this->continuousResynchroTimer_;63 this->continuousResynchroTimer_->destroy(); 64 64 } 65 65 … … 98 98 void MovableEntity::clientConnected(unsigned int clientID) 99 99 { 100 this->resynchronizeTimer_.setTimer(rnd() * MAX_RESYNCHRONIZE_TIME, false, this, createExecutor(createFunctor(&MovableEntity::resynchronize)));100 this->resynchronizeTimer_.setTimer(rnd() * MAX_RESYNCHRONIZE_TIME, false, createExecutor(createFunctor(&MovableEntity::resynchronize, this))); 101 101 } 102 102 … … 110 110 { 111 111 // Resynchronise every few seconds because we only work with velocities (no positions) 112 continuousResynchroTimer_ = new Timer <MovableEntity>(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1),113 true, this, createExecutor(createFunctor(&MovableEntity::resynchronize)), false);112 continuousResynchroTimer_ = new Timer(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1), 113 true, createExecutor(createFunctor(&MovableEntity::resynchronize, this)), false); 114 114 } 115 115 -
code/trunk/src/orxonox/worldentities/MovableEntity.h
r5781 r5929 96 96 Quaternion overwrite_orientation_; 97 97 98 Timer <MovableEntity>resynchronizeTimer_;99 Timer <MovableEntity>* continuousResynchroTimer_;98 Timer resynchronizeTimer_; 99 Timer* continuousResynchroTimer_; 100 100 101 101 Pawn* owner_; -
code/trunk/src/orxonox/worldentities/SpawnPoint.cc
r5781 r5929 50 50 COUT(1) << "Error: SpawnPoint has no Gametype" << std::endl; 51 51 52 this->set ObjectMode(0x0);52 this->setSyncMode(0x0); 53 53 } 54 54 -
code/trunk/src/orxonox/worldentities/SpawnPoint.h
r5781 r5929 33 33 34 34 #include <string> 35 #include "core/ Identifier.h"35 #include "core/SubclassIdentifier.h" 36 36 #include "worldentities/StaticEntity.h" 37 37 -
code/trunk/src/orxonox/worldentities/WorldEntity.cc
r5781 r5929 119 119 { 120 120 if ((*it)->getDeleteWithParent()) 121 delete (*(it++));121 (*(it++))->destroy(); 122 122 else 123 123 { … … 132 132 delete this->physicalBody_; 133 133 } 134 delete this->collisionShape_;134 this->collisionShape_->destroy(); 135 135 136 136 this->node_->detachAllObjects(); … … 175 175 void WorldEntity::registerVariables() 176 176 { 177 registerVariable(this->mainStateName_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedMainState ));177 registerVariable(this->mainStateName_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedMainStateName)); 178 178 179 179 registerVariable(this->bActive_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity)); -
code/trunk/src/orxonox/worldentities/pawns/Destroyer.cc
r5781 r5929 40 40 RegisterObject(Destroyer); 41 41 42 UnderAttack* gametype = orxonox_cast<UnderAttack*>(this->getGametype() );42 UnderAttack* gametype = orxonox_cast<UnderAttack*>(this->getGametype().get()); 43 43 if (gametype) 44 44 { -
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r5781 r5929 36 36 #include "network/NetworkFunction.h" 37 37 38 #include "interfaces/PawnListener.h"39 38 #include "PawnManager.h" 40 39 #include "infos/PlayerInfo.h" … … 93 92 if (this->isInitialized()) 94 93 { 95 for (ObjectList<PawnListener>::iterator it = ObjectList<PawnListener>::begin(); it != ObjectList<PawnListener>::end(); ++it)96 it->destroyedPawn(this);97 98 94 if (this->weaponSystem_) 99 delete this->weaponSystem_;95 this->weaponSystem_->destroy(); 100 96 } 101 97 } -
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
r5781 r5929 75 75 { 76 76 if (this->isInitialized() && this->engine_) 77 delete this->engine_;77 this->engine_->destroy(); 78 78 } 79 79 … … 207 207 else 208 208 { 209 delete object;209 object->destroy(); 210 210 } 211 211 } -
code/trunk/src/orxonox/worldentities/pawns/Spectator.cc
r5781 r5929 145 145 ControllableEntity::setPlayer(player); 146 146 147 // this->set ObjectMode(ObjectDirection::ToClient);147 // this->setSyncMode(ObjectDirection::ToClient); 148 148 } 149 149 -
code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc
r5781 r5929 31 31 32 32 #include "core/CoreIncludes.h" 33 #include " interfaces/PawnListener.h"33 #include "controllers/ArtificialController.h" 34 34 #include "interfaces/TeamColourable.h" 35 35 #include "gametypes/TeamBaseMatch.h" … … 45 45 this->state_ = BaseState::Uncontrolled; 46 46 47 TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype() );47 TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype().get()); 48 48 if (gametype) 49 49 { … … 58 58 this->fireEvent(); 59 59 60 TeamDeathmatch* gametype = orxonox_cast<TeamDeathmatch*>(this->getGametype() );60 TeamDeathmatch* gametype = orxonox_cast<TeamDeathmatch*>(this->getGametype().get()); 61 61 if (!gametype) 62 62 return; … … 92 92 93 93 // Call this so bots stop shooting at the base after they converted it 94 for (ObjectList< PawnListener>::iterator it = ObjectList<PawnListener>::begin(); it != ObjectList<PawnListener>::end(); ++it)95 it-> destroyedPawn(this);94 for (ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it != ObjectList<ArtificialController>::end(); ++it) 95 it->abandonTarget(this); 96 96 } 97 97 }
Note: See TracChangeset
for help on using the changeset viewer.