From 16e27d95b1248f2be453d8261169aebc582bbc7c Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Fri, 10 May 2013 16:50:20 +0200 Subject: [PATCH] Rename ParticleSystem:setLifetime/setParticleLife and getters to setEmitterLifetime/setParticleLifetime (issue #601) --- .../graphics/opengl/ParticleSystem.cpp | 8 +++---- src/modules/graphics/opengl/ParticleSystem.h | 8 +++---- .../graphics/opengl/wrap_ParticleSystem.cpp | 24 +++++++++---------- .../graphics/opengl/wrap_ParticleSystem.h | 8 +++---- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/modules/graphics/opengl/ParticleSystem.cpp b/src/modules/graphics/opengl/ParticleSystem.cpp index be6533b3b..9620f188e 100644 --- a/src/modules/graphics/opengl/ParticleSystem.cpp +++ b/src/modules/graphics/opengl/ParticleSystem.cpp @@ -237,17 +237,17 @@ int ParticleSystem::getEmissionRate() const return emissionRate; } -void ParticleSystem::setLifetime(float life) +void ParticleSystem::setEmitterLifetime(float life) { this->life = lifetime = life; } -float ParticleSystem::getLifetime() const +float ParticleSystem::getEmitterLifetime() const { return lifetime; } -void ParticleSystem::setParticleLife(float min, float max) +void ParticleSystem::setParticleLifetime(float min, float max) { particleLifeMin = min; if (max == 0) @@ -256,7 +256,7 @@ void ParticleSystem::setParticleLife(float min, float max) particleLifeMax = max; } -void ParticleSystem::getParticleLife(float *min, float *max) const +void ParticleSystem::getParticleLifetime(float *min, float *max) const { if (min) *min = particleLifeMin; diff --git a/src/modules/graphics/opengl/ParticleSystem.h b/src/modules/graphics/opengl/ParticleSystem.h index c4a6d9a70..f0d9afa45 100644 --- a/src/modules/graphics/opengl/ParticleSystem.h +++ b/src/modules/graphics/opengl/ParticleSystem.h @@ -131,26 +131,26 @@ public: * Sets the lifetime of the particle emitter (-1 means eternal) * @param life The lifetime (in seconds). **/ - void setLifetime(float life); + void setEmitterLifetime(float life); /** * Returns the lifetime of the particle emitter. **/ - float getLifetime() const; + float getEmitterLifetime() const; /** * Sets the life range of the particles. * @param lifeMin The minimum life. * @param lifeMax The maximum life (if 0, then becomes the same as minimum life). **/ - void setParticleLife(float min, float max = 0); + void setParticleLifetime(float min, float max = 0); /** * Gets the lifetime of a particle. * @param[out] min * @param[out] max **/ - void getParticleLife(float *min, float *max) const; + void getParticleLifetime(float *min, float *max) const; /** * Sets the position of the center of the emitter and the direction (if set to relative). diff --git a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp index 65d30a6ba..4a23dfecc 100644 --- a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp +++ b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp @@ -83,35 +83,35 @@ int w_ParticleSystem_getEmissionRate(lua_State *L) return 1; } -int w_ParticleSystem_setLifetime(lua_State *L) +int w_ParticleSystem_setEmitterLifetime(lua_State *L) { ParticleSystem *t = luax_checkparticlesystem(L, 1); float arg1 = (float)luaL_checknumber(L, 2); - t->setLifetime(arg1); + t->setEmitterLifetime(arg1); return 0; } -int w_ParticleSystem_getLifetime(lua_State *L) +int w_ParticleSystem_getEmitterLifetime(lua_State *L) { ParticleSystem *t = luax_checkparticlesystem(L, 1); - lua_pushnumber(L, t->getLifetime()); + lua_pushnumber(L, t->getEmitterLifetime()); return 1; } -int w_ParticleSystem_setParticleLife(lua_State *L) +int w_ParticleSystem_setParticleLifetime(lua_State *L) { ParticleSystem *t = luax_checkparticlesystem(L, 1); float arg1 = (float)luaL_checknumber(L, 2); float arg2 = (float)luaL_optnumber(L, 3, arg1); - t->setParticleLife(arg1, arg2); + t->setParticleLifetime(arg1, arg2); return 0; } -int w_ParticleSystem_getParticleLife(lua_State *L) +int w_ParticleSystem_getParticleLifetime(lua_State *L) { ParticleSystem *t = luax_checkparticlesystem(L, 1); float min, max; - t->getParticleLife(&min, &max); + t->getParticleLifetime(&min, &max); lua_pushnumber(L, min); lua_pushnumber(L, max); return 2; @@ -609,10 +609,10 @@ static const luaL_Reg functions[] = { "getBufferSize", w_ParticleSystem_getBufferSize }, { "setEmissionRate", w_ParticleSystem_setEmissionRate }, { "getEmissionRate", w_ParticleSystem_getEmissionRate }, - { "setLifetime", w_ParticleSystem_setLifetime }, - { "getLifetime", w_ParticleSystem_getLifetime }, - { "setParticleLife", w_ParticleSystem_setParticleLife }, - { "getParticleLife", w_ParticleSystem_getParticleLife }, + { "setEmitterLifetime", w_ParticleSystem_setEmitterLifetime }, + { "getEmitterLifetime", w_ParticleSystem_getEmitterLifetime }, + { "setParticleLifetime", w_ParticleSystem_setParticleLifetime }, + { "getParticleLifetime", w_ParticleSystem_getParticleLifetime }, { "setPosition", w_ParticleSystem_setPosition }, { "getPosition", w_ParticleSystem_getPosition }, { "getX", w_ParticleSystem_getX }, diff --git a/src/modules/graphics/opengl/wrap_ParticleSystem.h b/src/modules/graphics/opengl/wrap_ParticleSystem.h index e4d36a97a..4bcc30359 100644 --- a/src/modules/graphics/opengl/wrap_ParticleSystem.h +++ b/src/modules/graphics/opengl/wrap_ParticleSystem.h @@ -40,10 +40,10 @@ int w_ParticleSystem_setBufferSize(lua_State *L); int w_ParticleSystem_getBufferSize(lua_State *L); int w_ParticleSystem_setEmissionRate(lua_State *L); int w_ParticleSystem_getEmissionRate(lua_State *L); -int w_ParticleSystem_setLifetime(lua_State *L); -int w_ParticleSystem_getLifetime(lua_State *L); -int w_ParticleSystem_setParticleLife(lua_State *L); -int w_ParticleSystem_getParticleLife(lua_State *L); +int w_ParticleSystem_setEmitterLifetime(lua_State *L); +int w_ParticleSystem_getEmitterLifetime(lua_State *L); +int w_ParticleSystem_setParticleLifetime(lua_State *L); +int w_ParticleSystem_getParticleLifetime(lua_State *L); int w_ParticleSystem_setPosition(lua_State *L); int w_ParticleSystem_getPosition(lua_State *L); int w_ParticleSystem_getX(lua_State *L);