Browse Source

Fixed VS project files, and a bug where ParticleSystem::setSprite did not retain the new Image.

rude 15 years ago
parent
commit
ea38442770

+ 20 - 0
platform/msvc2008/image/image.vcproj

@@ -208,6 +208,14 @@
 		<File
 			RelativePath="..\..\..\src\modules\image\EncodedImageData.cpp"
 			>
+			<FileConfiguration
+				Name="Debug|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					ObjectFile="$(IntDir)\image\"
+				/>
+			</FileConfiguration>
 		</File>
 		<File
 			RelativePath="..\..\..\src\modules\image\EncodedImageData.h"
@@ -233,6 +241,18 @@
 			RelativePath="..\..\..\src\modules\image\ImageData.h"
 			>
 		</File>
+		<File
+			RelativePath="..\..\..\src\modules\image\wrap_EncodedImageData.cpp"
+			>
+			<FileConfiguration
+				Name="Debug|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					ObjectFile="$(IntDir)\image\"
+				/>
+			</FileConfiguration>
+		</File>
 		<File
 			RelativePath="..\..\..\src\modules\image\wrap_Image.cpp"
 			>

+ 12 - 0
platform/msvc2008/love.vcproj

@@ -1176,6 +1176,18 @@
 					RelativePath="..\..\src\modules\image\ImageData.h"
 					>
 				</File>
+				<File
+					RelativePath="..\..\src\modules\image\wrap_EncodedImageData.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							ObjectFile="$(IntDir)\image\"
+						/>
+					</FileConfiguration>
+				</File>
 				<File
 					RelativePath="..\..\src\modules\image\wrap_Image.cpp"
 					>

+ 4 - 9
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)