From 5bd4477d4cf413e90a6b9ef5c8991798a687a0ec Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 20 Nov 2018 08:35:18 +0800 Subject: =?UTF-8?q?*=E6=9B=B4=E6=96=B0sprite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/graphics/particles/je_particle_system.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/libjin/graphics/particles/je_particle_system.cpp') diff --git a/src/libjin/graphics/particles/je_particle_system.cpp b/src/libjin/graphics/particles/je_particle_system.cpp index 942da99..dcb84dd 100644 --- a/src/libjin/graphics/particles/je_particle_system.cpp +++ b/src/libjin/graphics/particles/je_particle_system.cpp @@ -18,6 +18,12 @@ namespace JinEngine { } + void ParticleSystem::setPosition(float x, float y) + { + mPosition.x = x; + mPosition.y = y; + } + void ParticleSystem::update(float dt) { mEmitter.update(dt); @@ -36,23 +42,20 @@ namespace JinEngine } } - void ParticleSystem::render(float x, float y, float sx /* = 1 */, float sy /* = 1 */, float r /* = 0 */, float ax /* = 0 */, float ay /* = 0 */) + void ParticleSystem::render() { - gl.push(); - gl.translate(x, y); for (Particle* p : mAliveParticles) p->render(); - gl.pop(); } - void ParticleSystem::setGraphic(const Graphic* graphic) + void ParticleSystem::setSprite(const Sprite* sprite) { - mGraphic = graphic; + mSprite = sprite; } Particle* ParticleSystem::claim() { - Particle* p = new (mParticlePool.GetNextWithoutInitializing()) Particle(mGraphic); + Particle* p = new (mParticlePool.GetNextWithoutInitializing()) Particle(mSprite); mAliveParticles.push_back(p); return p; } -- cgit v1.1-26-g67d0