Probably fixed compilation with GCC 4.8.

This commit is contained in:
Alex Szpakowski
2015-08-10 14:39:58 -03:00
parent 0b566f3c94
commit 6d9409a337
4 changed files with 13 additions and 24 deletions
+1 -1
View File
@@ -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.
@@ -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<Colorf> &newColors)
{
colors = newColors;
@@ -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
@@ -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<Colorf> 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<Colorf> 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;