From 713e050b5649390d2e06b03c845e50d47af9a557 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Thu, 22 Aug 2013 00:30:58 -0300 Subject: [PATCH] Removed some ParticleSystem methods which existed but did nothing since version 0.5.0 or earlier --- src/modules/graphics/opengl/ParticleSystem.cpp | 13 +------------ src/modules/graphics/opengl/ParticleSystem.h | 17 +---------------- .../graphics/opengl/wrap_ParticleSystem.cpp | 17 ----------------- .../graphics/opengl/wrap_ParticleSystem.h | 2 -- 4 files changed, 2 insertions(+), 47 deletions(-) diff --git a/src/modules/graphics/opengl/ParticleSystem.cpp b/src/modules/graphics/opengl/ParticleSystem.cpp index 1bd007d04..0d799eb02 100644 --- a/src/modules/graphics/opengl/ParticleSystem.cpp +++ b/src/modules/graphics/opengl/ParticleSystem.cpp @@ -44,7 +44,7 @@ love::math::RandomGenerator rng; Colorf colorToFloat(const Color &c) { - return Colorf((GLfloat)c.r/255.0f, (GLfloat)c.g/255.0f, (GLfloat)c.b/255.0f, (GLfloat)c.a/255.0f); + return Colorf((float)c.r/255.0f, (float)c.g/255.0f, (float)c.b/255.0f, (float)c.a/255.0f); } float calculate_variation(float inner, float outer, float var) @@ -93,7 +93,6 @@ ParticleSystem::ParticleSystem(Image *image, uint32 size) , particleLifeMax(0) , direction(0) , spread(0) - , relative(false) , speedMin(0) , speedMax(0) , linearAccelerationMin(0, 0) @@ -475,16 +474,6 @@ float ParticleSystem::getSpread() const return spread; } -void ParticleSystem::setRelativeDirection(bool relative) -{ - this->relative = relative; -} - -bool ParticleSystem::isRelativeDirection() const -{ - return relative; -} - void ParticleSystem::setSpeed(float speed) { speedMin = speedMax = speed; diff --git a/src/modules/graphics/opengl/ParticleSystem.h b/src/modules/graphics/opengl/ParticleSystem.h index ed6ea1f8b..87f33d782 100644 --- a/src/modules/graphics/opengl/ParticleSystem.h +++ b/src/modules/graphics/opengl/ParticleSystem.h @@ -157,7 +157,7 @@ public: 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. * Used to move the emitter without changing the position of already existing particles. * @param x The x-coordinate. * @param y The y-coordinate. @@ -214,18 +214,6 @@ public: **/ float getSpread() const; - /** - * Sets whether the direction should be relative to the particle emitter's movement. Used in conjunction with setPosition. - * @param relative Whether to have relative direction. - **/ - void setRelativeDirection(bool relative); - - /** - * Returns whether the direction is relative to the particle emitter's - * movement. - **/ - bool isRelativeDirection() const; - /** * Sets the speed of the particles. * @param speed The speed. @@ -579,9 +567,6 @@ protected: float direction; float spread; - // Whether the direction should be relative to the emitter's movement. - bool relative; - // The speed. float speedMin; float speedMax; diff --git a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp index b4594a4c5..374627ef1 100644 --- a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp +++ b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp @@ -237,21 +237,6 @@ int w_ParticleSystem_getSpread(lua_State *L) return 1; } -int w_ParticleSystem_setRelativeDirection(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - bool arg1 = (bool)luax_toboolean(L, 2); - t->setRelativeDirection(arg1); - return 0; -} - -int w_ParticleSystem_isRelativeDirection(lua_State *L) -{ - ParticleSystem *t = luax_checkparticlesystem(L, 1); - luax_pushboolean(L, t->isRelativeDirection()); - return 1; -} - int w_ParticleSystem_setSpeed(lua_State *L) { ParticleSystem *t = luax_checkparticlesystem(L, 1); @@ -647,8 +632,6 @@ static const luaL_Reg functions[] = { "getDirection", w_ParticleSystem_getDirection }, { "setSpread", w_ParticleSystem_setSpread }, { "getSpread", w_ParticleSystem_getSpread }, - { "setRelativeDirection", w_ParticleSystem_setRelativeDirection }, - { "isRelativeDirection", w_ParticleSystem_isRelativeDirection }, { "setSpeed", w_ParticleSystem_setSpeed }, { "getSpeed", w_ParticleSystem_getSpeed }, { "setLinearAcceleration", w_ParticleSystem_setLinearAcceleration }, diff --git a/src/modules/graphics/opengl/wrap_ParticleSystem.h b/src/modules/graphics/opengl/wrap_ParticleSystem.h index 43812fc62..0b0474a4d 100644 --- a/src/modules/graphics/opengl/wrap_ParticleSystem.h +++ b/src/modules/graphics/opengl/wrap_ParticleSystem.h @@ -54,8 +54,6 @@ int w_ParticleSystem_setDirection(lua_State *L); int w_ParticleSystem_getDirection(lua_State *L); int w_ParticleSystem_setSpread(lua_State *L); int w_ParticleSystem_getSpread(lua_State *L); -int w_ParticleSystem_setRelativeDirection(lua_State *L); -int w_ParticleSystem_isRelativeDirection(lua_State *L); int w_ParticleSystem_setSpeed(lua_State *L); int w_ParticleSystem_getSpeed(lua_State *L); int w_ParticleSystem_setLinearAcceleration(lua_State *L);