forked from mirror/OpenTTD
(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).
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user