mirror of https://github.com/OpenTTD/OpenTTD
(svn r10148) -Fix r10143: make --without-png to compile again
parent
2c6bf89e02
commit
4b51ea375b
|
@ -83,6 +83,7 @@ SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk '
|
||||||
deep += 1;
|
deep += 1;
|
||||||
|
|
||||||
if ($0 == "SDL" && "'$sdl_config'" == "") { next; }
|
if ($0 == "SDL" && "'$sdl_config'" == "") { next; }
|
||||||
|
if ($0 == "PNG" && "'$png_config'" == "") { next; }
|
||||||
if ($0 == "OSX" && "'$os'" != "OSX") { next; }
|
if ($0 == "OSX" && "'$os'" != "OSX") { next; }
|
||||||
if ($0 == "OS2" && "'$os'" != "OS2") { next; }
|
if ($0 == "OS2" && "'$os'" != "OS2") { next; }
|
||||||
if ($0 == "PSP" && "'$os'" != "PSP") { next; }
|
if ($0 == "PSP" && "'$os'" != "PSP") { next; }
|
||||||
|
|
|
@ -31,6 +31,7 @@ fi
|
||||||
|
|
||||||
# First, collect the list of Windows files
|
# First, collect the list of Windows files
|
||||||
sdl_config="1"
|
sdl_config="1"
|
||||||
|
png_config="1"
|
||||||
os="MSVC"
|
os="MSVC"
|
||||||
enable_dedicated="0"
|
enable_dedicated="0"
|
||||||
with_cocoa="0"
|
with_cocoa="0"
|
||||||
|
@ -52,6 +53,7 @@ load_main_data() {
|
||||||
deep += 1;
|
deep += 1;
|
||||||
|
|
||||||
if ($0 == "SDL" && "'$sdl_config'" == "") { next; }
|
if ($0 == "SDL" && "'$sdl_config'" == "") { next; }
|
||||||
|
if ($0 == "PNG" && "'$png_config'" == "") { next; }
|
||||||
if ($0 == "OSX" && "'$os'" != "OSX") { next; }
|
if ($0 == "OSX" && "'$os'" != "OSX") { next; }
|
||||||
if ($0 == "OS2" && "'$os'" != "OS2") { next; }
|
if ($0 == "OS2" && "'$os'" != "OS2") { next; }
|
||||||
if ($0 == "PSP" && "'$os'" != "PSP") { next; }
|
if ($0 == "PSP" && "'$os'" != "PSP") { next; }
|
||||||
|
|
|
@ -307,8 +307,10 @@ blitter/blitter.hpp
|
||||||
# Sprite loaders
|
# Sprite loaders
|
||||||
spriteloader/grf.cpp
|
spriteloader/grf.cpp
|
||||||
spriteloader/grf.hpp
|
spriteloader/grf.hpp
|
||||||
|
#if PNG
|
||||||
spriteloader/png.cpp
|
spriteloader/png.cpp
|
||||||
spriteloader/png.hpp
|
spriteloader/png.hpp
|
||||||
|
#end
|
||||||
spriteloader/spriteloader.hpp
|
spriteloader/spriteloader.hpp
|
||||||
|
|
||||||
# Renderer
|
# Renderer
|
||||||
|
|
|
@ -14,7 +14,9 @@
|
||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
#include "spriteloader/grf.hpp"
|
#include "spriteloader/grf.hpp"
|
||||||
|
#ifdef WITH_PNG
|
||||||
#include "spriteloader/png.hpp"
|
#include "spriteloader/png.hpp"
|
||||||
|
#endif /* WITH_PNG */
|
||||||
#include "blitter/blitter.hpp"
|
#include "blitter/blitter.hpp"
|
||||||
|
|
||||||
/* Default of 4MB spritecache */
|
/* Default of 4MB spritecache */
|
||||||
|
@ -137,6 +139,7 @@ static void* ReadSprite(SpriteCache *sc, SpriteID id, bool real_sprite)
|
||||||
file_pos = GetSpriteCache(SPR_IMG_QUERY)->file_pos;
|
file_pos = GetSpriteCache(SPR_IMG_QUERY)->file_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WITH_PNG
|
||||||
if (BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() == 32) {
|
if (BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() == 32) {
|
||||||
/* Try loading 32bpp graphics in case we are 32bpp output */
|
/* Try loading 32bpp graphics in case we are 32bpp output */
|
||||||
SpriteLoaderPNG sprite_loader;
|
SpriteLoaderPNG sprite_loader;
|
||||||
|
@ -150,6 +153,7 @@ static void* ReadSprite(SpriteCache *sc, SpriteID id, bool real_sprite)
|
||||||
}
|
}
|
||||||
/* If the PNG couldn't be loaded, fall back to 8bpp grfs */
|
/* If the PNG couldn't be loaded, fall back to 8bpp grfs */
|
||||||
}
|
}
|
||||||
|
#endif /* WITH_PNG */
|
||||||
|
|
||||||
FioSeekToFile(file_pos);
|
FioSeekToFile(file_pos);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue