/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: ... co-programmer: ... */ //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY #include "particle_engine.h" #include "particle_system.h" #include "particle_emitter.h" #include "list.h" using namespace std; /** \brief standard constructor */ ParticleEngine::ParticleEngine () { this->setClassName ("ParticleEngine"); this->systemList = new tList; } /** \brief the singleton reference to this class */ ParticleEngine* ParticleEngine::singletonRef = NULL; /** \returns a Pointer to this Class */ ParticleEngine* ParticleEngine::getInstance(void) { if (!ParticleEngine::singletonRef) ParticleEngine::singletonRef = new ParticleEngine(); return ParticleEngine::singletonRef; } /** \brief standard destructor */ ParticleEngine::~ParticleEngine () { delete this->systemList; ParticleEngine::singletonRef = NULL; } /** \brief this function ticks all the ParticleSystems, so an animation will flow \param dt passed since last tick */ void ParticleEngine::tick(float dt) { tIterator* tmpIt = systemList->getIterator(); ParticleSystem* tmpSys = tmpIt->nextElement(); while(tmpSys) { tmpSys->tick(dt); tmpSys = tmpIt->nextElement(); } delete tmpIt; }