From 955fb9b60cd3ab7afb711ed43ffe91aff7fd1b40 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Wed, 17 May 2017 18:51:42 -0300 Subject: [PATCH] =?UTF-8?q?Fixed=20love.graphics.draw(particlesystem,=20?= =?UTF-8?q?=E2=80=A6)=20to=20actually=20use=20the=20transformation=20param?= =?UTF-8?q?eters.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : minor --- src/modules/graphics/ParticleSystem.cpp | 4 +--- src/modules/graphics/ParticleSystem.h | 2 +- src/modules/graphics/opengl/ParticleSystem.cpp | 4 +++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/graphics/ParticleSystem.cpp b/src/modules/graphics/ParticleSystem.cpp index 9c69133ad..b6f7c23b8 100644 --- a/src/modules/graphics/ParticleSystem.cpp +++ b/src/modules/graphics/ParticleSystem.cpp @@ -1048,7 +1048,7 @@ void ParticleSystem::update(float dt) prevPosition = position; } -bool ParticleSystem::prepareDraw(Graphics *gfx, const Matrix4 &m) +bool ParticleSystem::prepareDraw(Graphics *gfx) { uint32 pCount = getCount(); @@ -1057,8 +1057,6 @@ bool ParticleSystem::prepareDraw(Graphics *gfx, const Matrix4 &m) gfx->flushStreamDraws(); - Graphics::TempTransform transform(gfx, m); - const vertex::XYf_STf *textureVerts = texture->getQuad()->getVertices(); Vertex *pVerts = (Vertex *) buffer->map(); Particle *p = pHead; diff --git a/src/modules/graphics/ParticleSystem.h b/src/modules/graphics/ParticleSystem.h index a60edf1fe..9278c9ca2 100644 --- a/src/modules/graphics/ParticleSystem.h +++ b/src/modules/graphics/ParticleSystem.h @@ -612,7 +612,7 @@ protected: int quadIndex; }; - bool prepareDraw(Graphics *gfx, const Matrix4 &m); + bool prepareDraw(Graphics *gfx); // Pointer to the beginning of the allocated memory. Particle *pMem; diff --git a/src/modules/graphics/opengl/ParticleSystem.cpp b/src/modules/graphics/opengl/ParticleSystem.cpp index dfa07b2c0..6f402b6f2 100644 --- a/src/modules/graphics/opengl/ParticleSystem.cpp +++ b/src/modules/graphics/opengl/ParticleSystem.cpp @@ -54,9 +54,11 @@ void ParticleSystem::draw(Graphics *gfx, const Matrix4 &m) { using namespace vertex; - if (!prepareDraw(gfx, m)) + if (!prepareDraw(gfx)) return; + Graphics::TempTransform transform(gfx, m); + if (Shader::current && texture.get()) Shader::current->checkMainTexture(texture);