From ea3844277021f0df1293b94705b0d968d784900f Mon Sep 17 00:00:00 2001 From: rude Date: Tue, 4 May 2010 18:06:10 +0200 Subject: [PATCH 1/2] Fixed VS project files, and a bug where ParticleSystem::setSprite did not retain the new Image. --- platform/msvc2008/image/image.vcproj | 20 +++++++++++++++++++ platform/msvc2008/love.vcproj | 12 +++++++++++ .../graphics/opengl/ParticleSystem.cpp | 13 ++++-------- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/platform/msvc2008/image/image.vcproj b/platform/msvc2008/image/image.vcproj index 92101cbc4..9c0f438f8 100644 --- a/platform/msvc2008/image/image.vcproj +++ b/platform/msvc2008/image/image.vcproj @@ -208,6 +208,14 @@ + + + + + + + + diff --git a/platform/msvc2008/love.vcproj b/platform/msvc2008/love.vcproj index 3a4a54bff..0ec8838df 100644 --- a/platform/msvc2008/love.vcproj +++ b/platform/msvc2008/love.vcproj @@ -1176,6 +1176,18 @@ RelativePath="..\..\src\modules\image\ImageData.h" > + + + + + diff --git a/src/modules/graphics/opengl/ParticleSystem.cpp b/src/modules/graphics/opengl/ParticleSystem.cpp index e8f1d26fe..a037c5266 100644 --- a/src/modules/graphics/opengl/ParticleSystem.cpp +++ b/src/modules/graphics/opengl/ParticleSystem.cpp @@ -62,10 +62,7 @@ namespace opengl ParticleSystem::~ParticleSystem() { if(this->sprite != 0) - { this->sprite->release(); - this->sprite = 0; - } if(pStart != 0) delete [] pStart; @@ -138,13 +135,11 @@ namespace opengl void ParticleSystem::setSprite(Image * image) { - if(this->sprite != 0) - { - this->sprite->release(); - this->sprite = 0; - } + if(sprite != 0) + sprite->release(); - this->sprite = image; + sprite = image; + sprite->retain(); } void ParticleSystem::setBufferSize(unsigned int size) From 684c3091454ec4eea933a031b1fca5ccf318a77f Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Wed, 5 May 2010 13:26:20 +0200 Subject: [PATCH 2/2] Bored at work. Did some Valgrind shit and fixed this 'error'. --- src/modules/graphics/opengl/Graphics.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index 2f41c6479..2e07123e5 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -37,6 +37,7 @@ namespace opengl // created yet. currentMode.width = 0; currentMode.height = 0; + currentMode.fullscreen = 0; // Window should be centered. SDL_putenv(const_cast("SDL_VIDEO_CENTERED=center"));