summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-06-13 19:34:33 +0000
committertruelight <truelight@openttd.org>2007-06-13 19:34:33 +0000
commitbda903e70bc4fb1a3d42edd846b03ae65e2371ce (patch)
treec357513a6ac69ba2027e335883675951659e298f
parent402052509f991672d97a1783a888109dc7688e24 (diff)
downloadopenttd-bda903e70bc4fb1a3d42edd846b03ae65e2371ce.tar.xz
(svn r10150) -Fix r10148: show a message to users when using 32bpp blitter and no libpng available
-rw-r--r--src/spritecache.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/spritecache.cpp b/src/spritecache.cpp
index d85af6b70..e9c4e15dd 100644
--- a/src/spritecache.cpp
+++ b/src/spritecache.cpp
@@ -139,8 +139,8 @@ static void* ReadSprite(SpriteCache *sc, SpriteID id, bool real_sprite)
file_pos = GetSpriteCache(SPR_IMG_QUERY)->file_pos;
}
-#ifdef WITH_PNG
if (BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() == 32) {
+#ifdef WITH_PNG
/* Try loading 32bpp graphics in case we are 32bpp output */
SpriteLoaderPNG sprite_loader;
SpriteLoader::Sprite sprite;
@@ -152,8 +152,14 @@ static void* ReadSprite(SpriteCache *sc, SpriteID id, bool real_sprite)
return sc->ptr;
}
/* If the PNG couldn't be loaded, fall back to 8bpp grfs */
- }
+#else
+ static bool show_once = true;
+ if (show_once) {
+ DEBUG(misc, 0, "You are running a 32bpp blitter, but this build is without libpng support; falling back to 8bpp graphics");
+ show_once = false;
+ }
#endif /* WITH_PNG */
+ }
FioSeekToFile(file_pos);