From eb2dc7ef91499310c5b505a5c99fd7fa069f6d34 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 8 Aug 2005 21:35:27 +0000 Subject: (svn r2845) Remove sprite size caching, it was unused This makes GetSpriteDimension() superflous, because now it's just a thin wrapper around GetSprite() returning only part of the information, therefore remove it too --- spritecache.c | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) (limited to 'spritecache.c') diff --git a/spritecache.c b/spritecache.c index c824e053f..8edbeed09 100644 --- a/spritecache.c +++ b/spritecache.c @@ -15,8 +15,6 @@ #define SPRITE_CACHE_SIZE 1024*1024 - -//#define WANT_SPRITESIZES #define WANT_NEW_LRU @@ -44,13 +42,6 @@ static uint16 _sprite_lru[MAX_SPRITES]; static uint16 _sprite_lru_cur[MAX_SPRITES]; #endif -#ifdef WANT_SPRITESIZES -static int8 _sprite_xoffs[MAX_SPRITES]; -static int8 _sprite_yoffs[MAX_SPRITES]; -static uint16 _sprite_xsize[MAX_SPRITES]; -static uint8 _sprite_ysize[MAX_SPRITES]; -#endif - typedef struct MemBlock { uint32 size; byte data[VARARRAY_SIZE]; @@ -116,14 +107,7 @@ static void ReadSpriteHeaderSkipData(int num, int load_index) return; } -#ifdef WANT_SPRITESIZES - _cur_sprite.height = FioReadByte(); - _cur_sprite.width = FioReadWord(); - _cur_sprite.x_offs = FioReadWord(); - _cur_sprite.y_offs = FioReadWord(); -#else FioSkipBytes(7); -#endif num -= 8; if (num == 0) return; @@ -253,14 +237,6 @@ static bool LoadNextSprite(int load_index, byte file_index) _sprite_size[load_index] = size; _sprite_file_pos[load_index] = file_pos; -#ifdef WANT_SPRITESIZES - _sprite_xsize[load_index] = _cur_sprite.width; - _sprite_ysize[load_index] = _cur_sprite.height; - - _sprite_xoffs[load_index] = _cur_sprite.x_offs; - _sprite_yoffs[load_index] = _cur_sprite.y_offs; -#endif - _sprite_ptr[load_index] = NULL; #if defined(WANT_NEW_LRU) @@ -853,27 +829,3 @@ void GfxLoadSprites(void) GfxInitPalettes(); } } - - -const SpriteDimension *GetSpriteDimension(SpriteID sprite) -{ - static SpriteDimension sd; - -#ifdef WANT_SPRITESIZES - sd.xoffs = _sprite_xoffs[sprite]; - sd.yoffs = _sprite_yoffs[sprite]; - sd.xsize = _sprite_xsize[sprite]; - sd.ysize = _sprite_ysize[sprite]; -#else - const Sprite* p = GetSprite(sprite); - - /* decode sprite header */ - sd.xoffs = p->x_offs; - sd.yoffs = p->y_offs; - sd.xsize = p->width; - sd.ysize = p->height; -#endif - - return &sd; -} - -- cgit v1.2.3-54-g00ecf