Browse Source

Probably fixed compilation with GCC 4.8.

Alex Szpakowski 10 years ago
parent
commit
6d9409a337

+ 1 - 1
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 "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" 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 "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:getPixel (use Canvas:newImageData instead.)
   * Removed Canvas:clear (use love.graphics.clear instead.)
   * Removed Canvas:clear (use love.graphics.clear instead.)
   * Removed Mesh:getVertices.
   * Removed Mesh:getVertices.

+ 0 - 5
src/modules/graphics/opengl/ParticleSystem.cpp

@@ -700,11 +700,6 @@ love::Vector ParticleSystem::getOffset() const
 	return offset;
 	return offset;
 }
 }
 
 
-void ParticleSystem::setColor(const Colorf &color)
-{
-	setColor({color});
-}
-
 void ParticleSystem::setColor(const std::vector<Colorf> &newColors)
 void ParticleSystem::setColor(const std::vector<Colorf> &newColors)
 {
 {
 	colors = newColors;
 	colors = newColors;

+ 0 - 6
src/modules/graphics/opengl/ParticleSystem.h

@@ -417,12 +417,6 @@ public:
 	 **/
 	 **/
 	love::Vector getOffset() const;
 	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.
 	 * Sets the color of the particles.
 	 * @param newColors Array of colors
 	 * @param newColors Array of colors

+ 12 - 12
src/modules/graphics/opengl/wrap_ParticleSystem.cpp

@@ -536,27 +536,27 @@ int w_ParticleSystem_setColors(lua_State *L)
 		if (nColors > 8)
 		if (nColors > 8)
 			return luaL_error(L, "At most eight (8) colors may be used.");
 			return luaL_error(L, "At most eight (8) colors may be used.");
 
 
+		std::vector<Colorf> colors(nColors);
+
 		if (nColors == 1)
 		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
 		else
 		{
 		{
-			std::vector<Colorf> colors(nColors);
 			for (int i = 0; i < nColors; ++i)
 			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;
 	return 0;