Browse Source

Added ParticleSystem:isPaused (issue #623) and removed ParticleSystem:isEmpty/isFull (issue #621)

Alex Szpakowski 12 years ago
parent
commit
0c58d5d46a

+ 3 - 0
changes.txt

@@ -105,6 +105,7 @@ LOVE 0.9.0 []
   * Removed love.graphics.setColorMode.
   * Removed love.graphics.setColorMode.
   * Removed love.graphics.newStencil.
   * Removed love.graphics.newStencil.
   * Removed Quad objects (replaced by Geometry).
   * Removed Quad objects (replaced by Geometry).
+  * Removed ParticleSystem:isFull/isEmpty.
   * Removed love.joystick.open and friends.
   * Removed love.joystick.open and friends.
   * Removed thread names.
   * Removed thread names.
   * Removed old thread messaging api (see Channels).
   * Removed old thread messaging api (see Channels).
@@ -124,8 +125,10 @@ LOVE 0.9.0 []
   * Updated love.graphics.newScreenshot to create a fully opaque image by default.
   * Updated love.graphics.newScreenshot to create a fully opaque image by default.
   * Updated error messages when sending bad values to Shaders.
   * Updated error messages when sending bad values to Shaders.
   * Updated love.graphics.newParticleSystem to have a default buffer size of 1000.
   * Updated love.graphics.newParticleSystem to have a default buffer size of 1000.
+  * Updated love.image.newImageData and love.graphics.newImage to accept FileData.
   * Updated ImageData:setPixel to accept a table and default to 255 alpha.
   * Updated ImageData:setPixel to accept a table and default to 255 alpha.
   * Updated love.image memory handling, improves errors and thread-safety.
   * Updated love.image memory handling, improves errors and thread-safety.
+  * Updated love.audio.newSource and love.sound.newDecoder/newSoundData to accept FileData.
   * Updated allocation for SoundData, it's more efficient and less wasteful.
   * Updated allocation for SoundData, it's more efficient and less wasteful.
   * Updated Source:set* functions to default z to 0.
   * Updated Source:set* functions to default z to 0.
   * Updated love.timer.getFPS to be microsecond-accurate.
   * Updated love.timer.getFPS to be microsecond-accurate.

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

@@ -573,6 +573,11 @@ bool ParticleSystem::isActive() const
 	return active;
 	return active;
 }
 }
 
 
+bool ParticleSystem::isPaused() const
+{
+	return !active && life < lifetime;
+}
+
 bool ParticleSystem::isEmpty() const
 bool ParticleSystem::isEmpty() const
 {
 {
 	return pStart == pLast;
 	return pStart == pLast;

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

@@ -468,6 +468,11 @@ public:
 	 **/
 	 **/
 	bool isActive() const;
 	bool isActive() const;
 
 
+	/**
+	 * Returns whether the particle emitter is paused.
+	 **/
+	bool isPaused() const;
+
 	/**
 	/**
 	 * Returns whether the particle system is empty of particles or not.
 	 * Returns whether the particle system is empty of particles or not.
 	 **/
 	 **/

+ 3 - 11
src/modules/graphics/opengl/wrap_ParticleSystem.cpp

@@ -579,17 +579,10 @@ int w_ParticleSystem_isActive(lua_State *L)
 	return 1;
 	return 1;
 }
 }
 
 
-int w_ParticleSystem_isEmpty(lua_State *L)
+int w_ParticleSystem_isPaused(lua_State *L)
 {
 {
 	ParticleSystem *t = luax_checkparticlesystem(L, 1);
 	ParticleSystem *t = luax_checkparticlesystem(L, 1);
-	luax_pushboolean(L, t->isEmpty());
-	return 1;
-}
-
-int w_ParticleSystem_isFull(lua_State *L)
-{
-	ParticleSystem *t = luax_checkparticlesystem(L, 1);
-	luax_pushboolean(L, t->isFull());
+	luax_pushboolean(L, t->isPaused());
 	return 1;
 	return 1;
 }
 }
 
 
@@ -654,8 +647,7 @@ static const luaL_Reg functions[] =
 	{ "reset", w_ParticleSystem_reset },
 	{ "reset", w_ParticleSystem_reset },
 	{ "emit", w_ParticleSystem_emit },
 	{ "emit", w_ParticleSystem_emit },
 	{ "isActive", w_ParticleSystem_isActive },
 	{ "isActive", w_ParticleSystem_isActive },
-	{ "isEmpty", w_ParticleSystem_isEmpty },
-	{ "isFull", w_ParticleSystem_isFull },
+	{ "isPaused", w_ParticleSystem_isPaused },
 	{ "update", w_ParticleSystem_update },
 	{ "update", w_ParticleSystem_update },
 	{ 0, 0 }
 	{ 0, 0 }
 };
 };

+ 1 - 2
src/modules/graphics/opengl/wrap_ParticleSystem.h

@@ -85,8 +85,7 @@ int w_ParticleSystem_pause(lua_State *L);
 int w_ParticleSystem_reset(lua_State *L);
 int w_ParticleSystem_reset(lua_State *L);
 int w_ParticleSystem_emit(lua_State *L);
 int w_ParticleSystem_emit(lua_State *L);
 int w_ParticleSystem_isActive(lua_State *L);
 int w_ParticleSystem_isActive(lua_State *L);
-int w_ParticleSystem_isEmpty(lua_State *L);
-int w_ParticleSystem_isFull(lua_State *L);
+int w_ParticleSystem_isPaused(lua_State *L);
 int w_ParticleSystem_update(lua_State *L);
 int w_ParticleSystem_update(lua_State *L);
 extern "C" int luaopen_particlesystem(lua_State *L);
 extern "C" int luaopen_particlesystem(lua_State *L);