summaryrefslogtreecommitdiff
path: root/src/spritecache.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-12 09:40:50 +0000
committerrubidium <rubidium@openttd.org>2007-06-12 09:40:50 +0000
commitbe0539cb436ab096ecade239bef00b065a013199 (patch)
tree2e8ccc53d7bc1c15d8284c9fd86329ea3cbd1943 /src/spritecache.h
parent8efb7e53ecf0627ccb654af7b8c341e46f506d46 (diff)
downloadopenttd-be0539cb436ab096ecade239bef00b065a013199.tar.xz
(svn r10109) -Fix [FS#838]: some NewGRFs use the same (unused in the "current" climate) sprite IDs. Normally this gives some artefacts, but when one NewGRF expects it to be a sprite and another NewGRF overwrites it with a non-sprite nasty things happen (drawing a non-sprite crashes OTTD).
Diffstat (limited to 'src/spritecache.h')
-rw-r--r--src/spritecache.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/spritecache.h b/src/spritecache.h
index 8356d0ff6..1b351bb0a 100644
--- a/src/spritecache.h
+++ b/src/spritecache.h
@@ -15,17 +15,17 @@ struct Sprite {
extern uint _sprite_cache_size;
-const void *GetRawSprite(SpriteID sprite);
+const void *GetRawSprite(SpriteID sprite, bool real_sprite);
bool SpriteExists(SpriteID sprite);
static inline const Sprite *GetSprite(SpriteID sprite)
{
- return (Sprite*)GetRawSprite(sprite);
+ return (Sprite*)GetRawSprite(sprite, true);
}
static inline const byte *GetNonSprite(SpriteID sprite)
{
- return (byte*)GetRawSprite(sprite);
+ return (byte*)GetRawSprite(sprite, false);
}
void GfxInitSpriteMem();