src/spritecache.h
branchNewGRF_ports
changeset 6720 35756db7e577
parent 6719 4cc327ad39d5
child 6872 1c4a4a609f85
equal deleted inserted replaced
6719:4cc327ad39d5 6720:35756db7e577
     4 
     4 
     5 #ifndef SPRITECACHE_H
     5 #ifndef SPRITECACHE_H
     6 #define SPRITECACHE_H
     6 #define SPRITECACHE_H
     7 
     7 
     8 struct Sprite {
     8 struct Sprite {
     9 	byte info;
       
    10 	byte height;
     9 	byte height;
    11 	uint16 width;
    10 	uint16 width;
    12 	int16 x_offs;
    11 	int16 x_offs;
    13 	int16 y_offs;
    12 	int16 y_offs;
    14 	byte data[VARARRAY_SIZE];
    13 	byte data[VARARRAY_SIZE];
    15 };
    14 };
    16 
    15 
    17 const void *GetRawSprite(SpriteID sprite);
    16 extern uint _sprite_cache_size;
       
    17 
       
    18 const void *GetRawSprite(SpriteID sprite, bool real_sprite);
    18 bool SpriteExists(SpriteID sprite);
    19 bool SpriteExists(SpriteID sprite);
    19 
    20 
    20 static inline const Sprite *GetSprite(SpriteID sprite)
    21 static inline const Sprite *GetSprite(SpriteID sprite)
    21 {
    22 {
    22 	return (Sprite*)GetRawSprite(sprite);
    23 	return (Sprite*)GetRawSprite(sprite, true);
    23 }
    24 }
    24 
    25 
    25 static inline const byte *GetNonSprite(SpriteID sprite)
    26 static inline const byte *GetNonSprite(SpriteID sprite)
    26 {
    27 {
    27 	return (byte*)GetRawSprite(sprite);
    28 	return (byte*)GetRawSprite(sprite, false);
    28 }
    29 }
    29 
    30 
    30 void GfxInitSpriteMem();
    31 void GfxInitSpriteMem();
    31 void IncreaseSpriteLRU();
    32 void IncreaseSpriteLRU();
    32 
    33 
    33 bool LoadNextSprite(int load_index, byte file_index);
    34 bool LoadNextSprite(int load_index, byte file_index, uint file_sprite_id);
    34 void DupSprite(SpriteID old_spr, SpriteID new_spr);
    35 void DupSprite(SpriteID old_spr, SpriteID new_spr);
    35 void SkipSprites(uint count);
    36 void SkipSprites(uint count);
    36 
    37 
    37 #endif /* SPRITECACHE_H */
    38 #endif /* SPRITECACHE_H */