Changeset 5929 for code/trunk/src/orxonox/graphics/ParticleSpawner.cc
- Timestamp:
- Oct 12, 2009, 8:20:07 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 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/graphics/ParticleSpawner.cc
r5781 r5929 71 71 } 72 72 73 void ParticleSpawner:: processEvent(Event& event)73 void ParticleSpawner::XMLEventPort(Element& xmlelement, XMLPort::Mode mode) 74 74 { 75 SUPER(ParticleSpawner, processEvent, event);75 SUPER(ParticleSpawner, XMLEventPort, xmlelement, mode); 76 76 77 ORXONOX_SET_EVENT(ParticleSpawner, "spawn", spawn, event);77 XMLPortEventState(ParticleSpawner, BaseObject, "spawn", spawn, xmlelement, mode); 78 78 } 79 79 … … 88 88 void ParticleSpawner::startParticleSpawner() 89 89 { 90 if (!this->particles_)91 return;92 93 90 this->setActive(false); 94 91 95 92 if (this->bForceDestroy_ || this->bSuppressStart_) 93 { 94 this->timer_.stopTimer(); 96 95 return; 96 } 97 97 98 this->timer_.setTimer(this->startdelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner)));98 this->timer_.setTimer(this->startdelay_, false, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner, this))); 99 99 } 100 100 … … 103 103 this->setActive(true); 104 104 if (this->lifetime_ != 0) 105 this->timer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&ParticleSpawner::stopParticleSpawner)));105 this->timer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&ParticleSpawner::stopParticleSpawner, this))); 106 106 } 107 107 … … 116 116 117 117 if (!this->timer_.isActive() || this->timer_.getRemainingTime() > this->destroydelay_) 118 this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));118 this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner, this))); 119 119 } 120 120 else if (this->bLoop_) 121 121 { 122 this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner)));122 this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner, this))); 123 123 } 124 124 } … … 126 126 void ParticleSpawner::destroyParticleSpawner() 127 127 { 128 delete this;128 this->destroy(); 129 129 } 130 130 }
Note: See TracChangeset
for help on using the changeset viewer.