mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Rename ParticleSystem:setLifetime/setParticleLife and getters to setEmitterLifetime/setParticleLifetime (issue #601)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user