spritecache.h

Go to the documentation of this file.
00001 /* $Id: spritecache.h 12002 2008-01-28 17:51:45Z peter1138 $ */
00002 
00005 #ifndef SPRITECACHE_H
00006 #define SPRITECACHE_H
00007 
00008 #include "gfx_type.h"
00009 
00010 struct Sprite {
00011   byte height;
00012   uint16 width;
00013   int16 x_offs;
00014   int16 y_offs;
00015   byte data[VARARRAY_SIZE];
00016 };
00017 
00018 extern uint _sprite_cache_size;
00019 
00020 const void *GetRawSprite(SpriteID sprite, bool real_sprite);
00021 bool SpriteExists(SpriteID sprite);
00022 
00023 static inline const Sprite *GetSprite(SpriteID sprite)
00024 {
00025   return (Sprite*)GetRawSprite(sprite, true);
00026 }
00027 
00028 static inline const byte *GetNonSprite(SpriteID sprite)
00029 {
00030   return (byte*)GetRawSprite(sprite, false);
00031 }
00032 
00033 void GfxInitSpriteMem();
00034 void IncreaseSpriteLRU();
00035 
00036 bool LoadNextSprite(int load_index, byte file_index, uint file_sprite_id);
00037 void DupSprite(SpriteID old_spr, SpriteID new_spr);
00038 
00039 #endif /* SPRITECACHE_H */

Generated on Wed Oct 1 17:03:23 2008 for openttd by  doxygen 1.5.6