Rename ParticleSystem:setLifetime/setParticleLife and getters to setEmitterLifetime/setParticleLifetime (issue #601)

This commit is contained in:
Bart van Strien
2013-05-10 16:50:20 +02:00
parent 721d50c2ef
commit 16e27d95b1
4 changed files with 24 additions and 24 deletions
@@ -237,17 +237,17 @@ int ParticleSystem::getEmissionRate() const
return emissionRate; return emissionRate;
} }
void ParticleSystem::setLifetime(float life) void ParticleSystem::setEmitterLifetime(float life)
{ {
this->life = lifetime = life; this->life = lifetime = life;
} }
float ParticleSystem::getLifetime() const float ParticleSystem::getEmitterLifetime() const
{ {
return lifetime; return lifetime;
} }
void ParticleSystem::setParticleLife(float min, float max) void ParticleSystem::setParticleLifetime(float min, float max)
{ {
particleLifeMin = min; particleLifeMin = min;
if (max == 0) if (max == 0)
@@ -256,7 +256,7 @@ void ParticleSystem::setParticleLife(float min, float max)
particleLifeMax = max; particleLifeMax = max;
} }
void ParticleSystem::getParticleLife(float *min, float *max) const void ParticleSystem::getParticleLifetime(float *min, float *max) const
{ {
if (min) if (min)
*min = particleLifeMin; *min = particleLifeMin;
+4 -4
View File
@@ -131,26 +131,26 @@ public:
* Sets the lifetime of the particle emitter (-1 means eternal) * Sets the lifetime of the particle emitter (-1 means eternal)
* @param life The lifetime (in seconds). * @param life The lifetime (in seconds).
**/ **/
void setLifetime(float life); void setEmitterLifetime(float life);
/** /**
* Returns the lifetime of the particle emitter. * Returns the lifetime of the particle emitter.
**/ **/
float getLifetime() const; float getEmitterLifetime() const;
/** /**
* Sets the life range of the particles. * Sets the life range of the particles.
* @param lifeMin The minimum life. * @param lifeMin The minimum life.
* @param lifeMax The maximum life (if 0, then becomes the same as 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. * Gets the lifetime of a particle.
* @param[out] min * @param[out] min
* @param[out] max * @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). * Sets the position of the center of the emitter and the direction (if set to relative).
@@ -83,35 +83,35 @@ int w_ParticleSystem_getEmissionRate(lua_State *L)
return 1; return 1;
} }
int w_ParticleSystem_setLifetime(lua_State *L) int w_ParticleSystem_setEmitterLifetime(lua_State *L)
{ {
ParticleSystem *t = luax_checkparticlesystem(L, 1); ParticleSystem *t = luax_checkparticlesystem(L, 1);
float arg1 = (float)luaL_checknumber(L, 2); float arg1 = (float)luaL_checknumber(L, 2);
t->setLifetime(arg1); t->setEmitterLifetime(arg1);
return 0; return 0;
} }
int w_ParticleSystem_getLifetime(lua_State *L) int w_ParticleSystem_getEmitterLifetime(lua_State *L)
{ {
ParticleSystem *t = luax_checkparticlesystem(L, 1); ParticleSystem *t = luax_checkparticlesystem(L, 1);
lua_pushnumber(L, t->getLifetime()); lua_pushnumber(L, t->getEmitterLifetime());
return 1; return 1;
} }
int w_ParticleSystem_setParticleLife(lua_State *L) int w_ParticleSystem_setParticleLifetime(lua_State *L)
{ {
ParticleSystem *t = luax_checkparticlesystem(L, 1); ParticleSystem *t = luax_checkparticlesystem(L, 1);
float arg1 = (float)luaL_checknumber(L, 2); float arg1 = (float)luaL_checknumber(L, 2);
float arg2 = (float)luaL_optnumber(L, 3, arg1); float arg2 = (float)luaL_optnumber(L, 3, arg1);
t->setParticleLife(arg1, arg2); t->setParticleLifetime(arg1, arg2);
return 0; return 0;
} }
int w_ParticleSystem_getParticleLife(lua_State *L) int w_ParticleSystem_getParticleLifetime(lua_State *L)
{ {
ParticleSystem *t = luax_checkparticlesystem(L, 1); ParticleSystem *t = luax_checkparticlesystem(L, 1);
float min, max; float min, max;
t->getParticleLife(&min, &max); t->getParticleLifetime(&min, &max);
lua_pushnumber(L, min); lua_pushnumber(L, min);
lua_pushnumber(L, max); lua_pushnumber(L, max);
return 2; return 2;
@@ -609,10 +609,10 @@ static const luaL_Reg functions[] =
{ "getBufferSize", w_ParticleSystem_getBufferSize }, { "getBufferSize", w_ParticleSystem_getBufferSize },
{ "setEmissionRate", w_ParticleSystem_setEmissionRate }, { "setEmissionRate", w_ParticleSystem_setEmissionRate },
{ "getEmissionRate", w_ParticleSystem_getEmissionRate }, { "getEmissionRate", w_ParticleSystem_getEmissionRate },
{ "setLifetime", w_ParticleSystem_setLifetime }, { "setEmitterLifetime", w_ParticleSystem_setEmitterLifetime },
{ "getLifetime", w_ParticleSystem_getLifetime }, { "getEmitterLifetime", w_ParticleSystem_getEmitterLifetime },
{ "setParticleLife", w_ParticleSystem_setParticleLife }, { "setParticleLifetime", w_ParticleSystem_setParticleLifetime },
{ "getParticleLife", w_ParticleSystem_getParticleLife }, { "getParticleLifetime", w_ParticleSystem_getParticleLifetime },
{ "setPosition", w_ParticleSystem_setPosition }, { "setPosition", w_ParticleSystem_setPosition },
{ "getPosition", w_ParticleSystem_getPosition }, { "getPosition", w_ParticleSystem_getPosition },
{ "getX", w_ParticleSystem_getX }, { "getX", w_ParticleSystem_getX },
@@ -40,10 +40,10 @@ int w_ParticleSystem_setBufferSize(lua_State *L);
int w_ParticleSystem_getBufferSize(lua_State *L); int w_ParticleSystem_getBufferSize(lua_State *L);
int w_ParticleSystem_setEmissionRate(lua_State *L); int w_ParticleSystem_setEmissionRate(lua_State *L);
int w_ParticleSystem_getEmissionRate(lua_State *L); int w_ParticleSystem_getEmissionRate(lua_State *L);
int w_ParticleSystem_setLifetime(lua_State *L); int w_ParticleSystem_setEmitterLifetime(lua_State *L);
int w_ParticleSystem_getLifetime(lua_State *L); int w_ParticleSystem_getEmitterLifetime(lua_State *L);
int w_ParticleSystem_setParticleLife(lua_State *L); int w_ParticleSystem_setParticleLifetime(lua_State *L);
int w_ParticleSystem_getParticleLife(lua_State *L); int w_ParticleSystem_getParticleLifetime(lua_State *L);
int w_ParticleSystem_setPosition(lua_State *L); int w_ParticleSystem_setPosition(lua_State *L);
int w_ParticleSystem_getPosition(lua_State *L); int w_ParticleSystem_getPosition(lua_State *L);
int w_ParticleSystem_getX(lua_State *L); int w_ParticleSystem_getX(lua_State *L);