From 6d9409a337decf78c8d4f3b1a1c9b65ae69a7d17 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 10 Aug 2015 14:39:58 -0300 Subject: [PATCH] Probably fixed compilation with GCC 4.8. --- changes.txt | 2 +- .../graphics/opengl/ParticleSystem.cpp | 5 ---- src/modules/graphics/opengl/ParticleSystem.h | 6 ----- .../graphics/opengl/wrap_ParticleSystem.cpp | 24 +++++++++---------- 4 files changed, 13 insertions(+), 24 deletions(-) diff --git a/changes.txt b/changes.txt index af8ce6717..54b0d108b 100644 --- a/changes.txt +++ b/changes.txt @@ -69,7 +69,7 @@ Released: N/A * Removed the "canvas", "shader", "npot", "subtractive", and "mipmap" Graphics Feature constant (the features always have guaranteed support now.) * Removed the "srgb" Graphics Feature constant (use love.graphics.isGammaCorrect() or love.graphics.getCanvasFormats().srgb instead.) * Removed the "srgb" flag in love.window.setMode and in the t.window table in love.conf (Replaced by t.gammacorrect.) - * Removed the "premultiplied" blend mode (love.graphics.setBlendMode"alpha", false) now does the same thing.) + * Removed the "premultiplied" blend mode (love.graphics.setBlendMode("alpha", false) now does the same thing.) * Removed Canvas:getPixel (use Canvas:newImageData instead.) * Removed Canvas:clear (use love.graphics.clear instead.) * Removed Mesh:getVertices. diff --git a/src/modules/graphics/opengl/ParticleSystem.cpp b/src/modules/graphics/opengl/ParticleSystem.cpp index 2c295c91c..f6b5b4b08 100644 --- a/src/modules/graphics/opengl/ParticleSystem.cpp +++ b/src/modules/graphics/opengl/ParticleSystem.cpp @@ -700,11 +700,6 @@ love::Vector ParticleSystem::getOffset() const return offset; } -void ParticleSystem::setColor(const Colorf &color) -{ - setColor({color}); -} - void ParticleSystem::setColor(const std::vector &newColors) { colors = newColors; diff --git a/src/modules/graphics/opengl/ParticleSystem.h b/src/modules/graphics/opengl/ParticleSystem.h index 1774d0eab..8502f826b 100644 --- a/src/modules/graphics/opengl/ParticleSystem.h +++ b/src/modules/graphics/opengl/ParticleSystem.h @@ -417,12 +417,6 @@ public: **/ love::Vector getOffset() const; - /** - * Sets the color of the particles. - * @param color The color. - **/ - void setColor(const Colorf &color); - /** * Sets the color of the particles. * @param newColors Array of colors diff --git a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp index 5aea58fe4..d13b3fd51 100644 --- a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp +++ b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp @@ -536,27 +536,27 @@ int w_ParticleSystem_setColors(lua_State *L) if (nColors > 8) return luaL_error(L, "At most eight (8) colors may be used."); + std::vector colors(nColors); + if (nColors == 1) { - float r = (float) luaL_checknumber(L, 2); - float g = (float) luaL_checknumber(L, 3); - float b = (float) luaL_checknumber(L, 4); - float a = (float) luaL_optnumber(L, 5, 255); - t->setColor(Colorf(r,g,b,a)); + colors[0].r = (float) luaL_checknumber(L, 2); + colors[0].g = (float) luaL_checknumber(L, 3); + colors[0].b = (float) luaL_checknumber(L, 4); + colors[0].a = (float) luaL_optnumber(L, 5, 255); } else { - std::vector colors(nColors); for (int i = 0; i < nColors; ++i) { - float r = (float) luaL_checknumber(L, 1 + i*4 + 1); - float g = (float) luaL_checknumber(L, 1 + i*4 + 2); - float b = (float) luaL_checknumber(L, 1 + i*4 + 3); - float a = (float) luaL_checknumber(L, 1 + i*4 + 4); - colors[i] = Colorf(r,g,b,a); + colors[i].r = (float) luaL_checknumber(L, 1 + i*4 + 1); + colors[i].g = (float) luaL_checknumber(L, 1 + i*4 + 2); + colors[i].b = (float) luaL_checknumber(L, 1 + i*4 + 3); + colors[i].a = (float) luaL_checknumber(L, 1 + i*4 + 4); } - t->setColor(colors); } + + t->setColor(colors); } return 0;