diff options
Diffstat (limited to 'src/libjin/Graphics/particles/je_particle_system.h')
-rw-r--r-- | src/libjin/Graphics/particles/je_particle_system.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/libjin/Graphics/particles/je_particle_system.h b/src/libjin/Graphics/particles/je_particle_system.h index afa96b2..8ee79ec 100644 --- a/src/libjin/Graphics/particles/je_particle_system.h +++ b/src/libjin/Graphics/particles/je_particle_system.h @@ -22,10 +22,10 @@ namespace JinEngine /// /// Definition of particle system. /// - struct ParticleSystemDef : public Temporary + struct ParticleSystemDef { + ParticleSystemDef() {} uint maxParticleCount = 1; ///< Max count of particles in pool. 1 by default. - ParticleEmitterDef emitterDef; ///< Particle emitter definition. ParticleDef particleDef; ///< Particle definition. }; @@ -33,7 +33,7 @@ namespace JinEngine /// /// Particle emitter, handle all particles it emitts. /// - class ParticleSystem : public Game::GameObject + class ParticleSystem/* : public Game::GameObject*/ { public: /// @@ -51,25 +51,37 @@ namespace JinEngine /// /// Update particle system and all alive particles. /// - void update(float sec); + void update(float dt); /// /// Render particle system. /// - void render(int x, int y, float sx = 1, float sy = 1, float r = 0, float ax = 0, float ay = 0); + void render(float x, float y, float sx = 1, float sy = 1, float r = 0, float ax = 0, float ay = 0); /// /// Set sprite to render. /// /// @param sprite Sprite to render. /// - void setSprite(Sprite* sprite); + void setGraphic(const Graphic* graphic); private: - // Disable default constructor. + + friend class ParticleEmitter; + ParticleSystem(); /// + /// + /// + Particle* claim(); + + /// + /// + /// + void recycle(int i, Particle* p); + + /// /// Particle system definition. /// ParticleSystemDef mDef; @@ -77,7 +89,7 @@ namespace JinEngine /// /// Sprite to be drawn. /// - Sprite* mSprite; + const Graphic* mGraphic; /// /// Particle emitter. |