diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index bb6ffa968..5d9253074 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -45,6 +45,7 @@ Graphics::Graphics() , lineWidth(1) , matrixLimit(0) , userMatrices(0) + , colorMask() { currentWindow = love::window::sdl::Window::getSingleton(); } diff --git a/src/modules/graphics/opengl/OpenGL.cpp b/src/modules/graphics/opengl/OpenGL.cpp index 7f59ccad0..4821e77da 100644 --- a/src/modules/graphics/opengl/OpenGL.cpp +++ b/src/modules/graphics/opengl/OpenGL.cpp @@ -35,11 +35,8 @@ namespace graphics namespace opengl { -// OpenGL class instance singleton. -OpenGL gl; - OpenGL::OpenGL() - : contexInitialized(false) + : contextInitialized(false) , maxAnisotropy(1.0f) , state() { @@ -47,7 +44,7 @@ OpenGL::OpenGL() void OpenGL::initContext() { - if (contexInitialized) + if (contextInitialized) return; initOpenGLFunctions(); @@ -99,15 +96,15 @@ void OpenGL::initContext() createDefaultTexture(); - contexInitialized = true; + contextInitialized = true; } void OpenGL::deInitContext() { - if (!contexInitialized) + if (!contextInitialized) return; - contexInitialized = false; + contextInitialized = false; } void OpenGL::initOpenGLFunctions() @@ -396,6 +393,9 @@ graphics::Image::Wrap OpenGL::getTextureWrap() return w; } +// OpenGL class instance singleton. +OpenGL gl; + } // opengl } // graphics } // love diff --git a/src/modules/graphics/opengl/OpenGL.h b/src/modules/graphics/opengl/OpenGL.h index 18884c430..69caef39f 100644 --- a/src/modules/graphics/opengl/OpenGL.h +++ b/src/modules/graphics/opengl/OpenGL.h @@ -103,22 +103,22 @@ public: /** * Sets the image filter mode for the currently bound texture. * Returns the actual amount of anisotropic filtering set. - */ + **/ float setTextureFilter(const graphics::Image::Filter &f); /** * Returns the image filter mode for the currently bound texture. - */ + **/ graphics::Image::Filter getTextureFilter(); /** * Sets the image wrap mode for the currently bound texture. - */ + **/ void setTextureWrap(const graphics::Image::Wrap &w); /** * Returns the image wrap mode for the currently bound texture. - */ + **/ graphics::Image::Wrap getTextureWrap(); private: @@ -126,7 +126,7 @@ private: void initOpenGLFunctions(); void createDefaultTexture(); - bool contexInitialized; + bool contextInitialized; float maxAnisotropy; // Tracked OpenGL state. diff --git a/src/modules/graphics/opengl/wrap_Graphics.h b/src/modules/graphics/opengl/wrap_Graphics.h index 9a99edda2..bf62bd14d 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.h +++ b/src/modules/graphics/opengl/wrap_Graphics.h @@ -54,8 +54,8 @@ int w_getDimensions(lua_State *L); int w_isCreated(lua_State *L); int w_setScissor(lua_State *L); int w_getScissor(lua_State *L); -int w_defineMask(lua_State *L); -int w_setMask(lua_State *L); +int w_newStencil(lua_State *L); +int w_setStencil(lua_State *L); int w_setAlphaTest(lua_State *L); int w_getAlphaTest(lua_State *L); int w_newImage(lua_State *L); diff --git a/src/modules/graphics/opengl/wrap_ParticleSystem.h b/src/modules/graphics/opengl/wrap_ParticleSystem.h index f189c7a9a..ad2eac332 100644 --- a/src/modules/graphics/opengl/wrap_ParticleSystem.h +++ b/src/modules/graphics/opengl/wrap_ParticleSystem.h @@ -40,6 +40,7 @@ int w_ParticleSystem_setEmissionRate(lua_State *L); int w_ParticleSystem_setLifetime(lua_State *L); int w_ParticleSystem_setParticleLife(lua_State *L); int w_ParticleSystem_setPosition(lua_State *L); +int w_ParticleSystem_setAreaSpread(lua_State *L); int w_ParticleSystem_setDirection(lua_State *L); int w_ParticleSystem_setSpread(lua_State *L); int w_ParticleSystem_setRelativeDirection(lua_State *L); @@ -58,6 +59,7 @@ int w_ParticleSystem_setOffset(lua_State *L); int w_ParticleSystem_getX(lua_State *L); int w_ParticleSystem_getY(lua_State *L); int w_ParticleSystem_getPosition(lua_State *L); +int w_ParticleSystem_getAreaSpread(lua_State *L); int w_ParticleSystem_getDirection(lua_State *L); int w_ParticleSystem_getSpread(lua_State *L); int w_ParticleSystem_getOffsetX(lua_State *L); diff --git a/src/modules/math/MathModule.cpp b/src/modules/math/MathModule.cpp index 8a1fc5ee9..e5a4fe668 100644 --- a/src/modules/math/MathModule.cpp +++ b/src/modules/math/MathModule.cpp @@ -82,18 +82,12 @@ namespace math Math Math::instance; Math::Math() - : rng(newRandomGenerator()) + : rng() { // prevent the runtime from free()-ing this retain(); } -Math::~Math() -{ - if (rng) - rng->release(); -} - RandomGenerator *Math::newRandomGenerator() { return new RandomGenerator(); diff --git a/src/modules/math/MathModule.h b/src/modules/math/MathModule.h index ea7499932..483018aa2 100644 --- a/src/modules/math/MathModule.h +++ b/src/modules/math/MathModule.h @@ -41,18 +41,19 @@ class Math : public Module { private: - RandomGenerator *rng; + RandomGenerator rng; public: - virtual ~Math(); + virtual ~Math() + {} /** * @copydoc RandomGenerator::randomseed() **/ inline void randomseed(uint64 seed) { - rng->randomseed(seed); + rng.randomseed(seed); } /** @@ -60,7 +61,7 @@ public: **/ inline double random() { - return rng->random(); + return rng.random(); } /** @@ -68,7 +69,7 @@ public: **/ inline double random(double max) { - return rng->random(max); + return rng.random(max); } /** @@ -76,7 +77,7 @@ public: **/ inline double random(double min, double max) { - return rng->random(min, max); + return rng.random(min, max); } /** @@ -84,7 +85,7 @@ public: **/ inline double randomnormal(double stddev) { - return rng->randomnormal(stddev); + return rng.randomnormal(stddev); } /**