Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 13, 2009, 5:05:17 PM (15 years ago)
Author:
dafrick
Message:

Hopefully merged trunk successfully into pickup branch.

Location:
code/branches/pickup
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup

  • code/branches/pickup/src/orxonox/graphics/ParticleSpawner.cc

    r5781 r5935  
    7171    }
    7272
    73     void ParticleSpawner::processEvent(Event& event)
     73    void ParticleSpawner::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
    7474    {
    75         SUPER(ParticleSpawner, processEvent, event);
     75        SUPER(ParticleSpawner, XMLEventPort, xmlelement, mode);
    7676
    77         ORXONOX_SET_EVENT(ParticleSpawner, "spawn", spawn, event);
     77        XMLPortEventState(ParticleSpawner, BaseObject, "spawn", spawn, xmlelement, mode);
    7878    }
    7979
     
    8888    void ParticleSpawner::startParticleSpawner()
    8989    {
    90         if (!this->particles_)
    91             return;
    92 
    9390        this->setActive(false);
    9491
    9592        if (this->bForceDestroy_ || this->bSuppressStart_)
     93        {
     94            this->timer_.stopTimer();
    9695            return;
     96        }
    9797
    98         this->timer_.setTimer(this->startdelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner)));
     98        this->timer_.setTimer(this->startdelay_, false, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner, this)));
    9999    }
    100100
     
    103103        this->setActive(true);
    104104        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)));
    106106    }
    107107
     
    116116
    117117            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)));
    119119        }
    120120        else if (this->bLoop_)
    121121        {
    122             this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner)));
     122            this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner, this)));
    123123        }
    124124    }
     
    126126    void ParticleSpawner::destroyParticleSpawner()
    127127    {
    128         delete this;
     128        this->destroy();
    129129    }
    130130}
Note: See TracChangeset for help on using the changeset viewer.