diff --git a/src/modules/graphics/opengl/ParticleSystem.cpp b/src/modules/graphics/opengl/ParticleSystem.cpp index a9b1872db..6fbbb546f 100644 --- a/src/modules/graphics/opengl/ParticleSystem.cpp +++ b/src/modules/graphics/opengl/ParticleSystem.cpp @@ -578,6 +578,11 @@ bool ParticleSystem::isPaused() const return !active && life < lifetime; } +bool ParticleSystem::isStopped() const +{ + return !active && life >= lifetime; +} + bool ParticleSystem::isEmpty() const { return pStart == pLast; diff --git a/src/modules/graphics/opengl/ParticleSystem.h b/src/modules/graphics/opengl/ParticleSystem.h index 1e45b0d4b..24a463fa8 100644 --- a/src/modules/graphics/opengl/ParticleSystem.h +++ b/src/modules/graphics/opengl/ParticleSystem.h @@ -473,6 +473,8 @@ public: **/ bool isPaused() const; + bool isStopped() const; + /** * Returns whether the particle system is empty of particles or not. **/ diff --git a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp index e29519f31..b94e7c2a2 100644 --- a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp +++ b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp @@ -586,6 +586,13 @@ int w_ParticleSystem_isPaused(lua_State *L) return 1; } +int w_ParticleSystem_isStopped(lua_State *L) +{ + ParticleSystem *t = luax_checkparticlesystem(L, 1); + luax_pushboolean(L, t->isStopped()); + return 1; +} + int w_ParticleSystem_update(lua_State *L) { ParticleSystem *t = luax_checkparticlesystem(L, 1); @@ -648,6 +655,7 @@ static const luaL_Reg functions[] = { "emit", w_ParticleSystem_emit }, { "isActive", w_ParticleSystem_isActive }, { "isPaused", w_ParticleSystem_isPaused }, + { "isStopped", w_ParticleSystem_isStopped }, { "update", w_ParticleSystem_update }, { 0, 0 } }; diff --git a/src/modules/graphics/opengl/wrap_ParticleSystem.h b/src/modules/graphics/opengl/wrap_ParticleSystem.h index c90f9471c..784717bf8 100644 --- a/src/modules/graphics/opengl/wrap_ParticleSystem.h +++ b/src/modules/graphics/opengl/wrap_ParticleSystem.h @@ -86,6 +86,7 @@ int w_ParticleSystem_reset(lua_State *L); int w_ParticleSystem_emit(lua_State *L); int w_ParticleSystem_isActive(lua_State *L); int w_ParticleSystem_isPaused(lua_State *L); +int w_ParticleSystem_isStopped(lua_State *L); int w_ParticleSystem_update(lua_State *L); extern "C" int luaopen_particlesystem(lua_State *L);