(svn r10148) -Fix r10143: make --without-png to compile again
authortruelight
Wed, 13 Jun 2007 18:52:06 +0000
changeset 7397 d371cc0fbb3c
parent 7396 9376076d058e
child 7398 4f7ae78d1212
(svn r10148) -Fix r10143: make --without-png to compile again
configure
projects/generate
source.list
src/spritecache.cpp
--- a/configure	Wed Jun 13 18:36:04 2007 +0000
+++ b/configure	Wed Jun 13 18:52:06 2007 +0000
@@ -83,6 +83,7 @@
 		deep += 1;
 
 		if ($0 == "SDL"         && "'$sdl_config'" == "")          { next; }
+		if ($0 == "PNG"         && "'$png_config'" == "")          { next; }
 		if ($0 == "OSX"         && "'$os'" != "OSX")               { next; }
 		if ($0 == "OS2"         && "'$os'" != "OS2")               { next; }
 		if ($0 == "PSP"         && "'$os'" != "PSP")               { next; }
--- a/projects/generate	Wed Jun 13 18:36:04 2007 +0000
+++ b/projects/generate	Wed Jun 13 18:52:06 2007 +0000
@@ -31,6 +31,7 @@
 
 # First, collect the list of Windows files
 sdl_config="1"
+png_config="1"
 os="MSVC"
 enable_dedicated="0"
 with_cocoa="0"
@@ -52,6 +53,7 @@
 			deep += 1;
 
 			if ($0 == "SDL"         && "'$sdl_config'" == "")          { next; }
+			if ($0 == "PNG"         && "'$png_config'" == "")          { next; }
 			if ($0 == "OSX"         && "'$os'" != "OSX")               { next; }
 			if ($0 == "OS2"         && "'$os'" != "OS2")               { next; }
 			if ($0 == "PSP"         && "'$os'" != "PSP")               { next; }
--- a/source.list	Wed Jun 13 18:36:04 2007 +0000
+++ b/source.list	Wed Jun 13 18:52:06 2007 +0000
@@ -307,8 +307,10 @@
 # Sprite loaders
 spriteloader/grf.cpp
 spriteloader/grf.hpp
+#if PNG
 spriteloader/png.cpp
 spriteloader/png.hpp
+#end
 spriteloader/spriteloader.hpp
 
 # Renderer
--- a/src/spritecache.cpp	Wed Jun 13 18:36:04 2007 +0000
+++ b/src/spritecache.cpp	Wed Jun 13 18:52:06 2007 +0000
@@ -14,7 +14,9 @@
 #include "fileio.h"
 #include "helpers.hpp"
 #include "spriteloader/grf.hpp"
+#ifdef WITH_PNG
 #include "spriteloader/png.hpp"
+#endif /* WITH_PNG */
 #include "blitter/blitter.hpp"
 
 /* Default of 4MB spritecache */
@@ -137,6 +139,7 @@
 		file_pos = GetSpriteCache(SPR_IMG_QUERY)->file_pos;
 	}
 
+#ifdef WITH_PNG
 	if (BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() == 32) {
 		/* Try loading 32bpp graphics in case we are 32bpp output */
 		SpriteLoaderPNG sprite_loader;
@@ -150,6 +153,7 @@
 		}
 		/* If the PNG couldn't be loaded, fall back to 8bpp grfs */
 	}
+#endif /* WITH_PNG */
 
 	FioSeekToFile(file_pos);