(svn r19723) -Add: a simple sprite alignment helper. It does not store the new offsets anywhere so as soon as the sprite is reloaded the offsets are gone (use a bigger sprite cache if this happens). Also anything that reloads NewGRFs (new games, loading games or (re)applying NewGRFs) clears the sprite cache and as such resets the offsets.

This commit is contained in:
rubidium
2010-04-25 16:27:30 +00:00
parent 4868fb988f
commit c72e2dde60
7 changed files with 264 additions and 1 deletions

View File

@@ -28,6 +28,11 @@ extern uint _sprite_cache_size;
void *GetRawSprite(SpriteID sprite, SpriteType type);
bool SpriteExists(SpriteID sprite);
SpriteType GetSpriteType(SpriteID sprite);
uint GetOriginFileSlot(SpriteID sprite);
uint GetMaxSpriteID();
static inline const Sprite *GetSprite(SpriteID sprite, SpriteType type)
{
assert(type != ST_RECOLOUR);