1
0
Fork 0

(svn r1865) Fix some warnings

release/0.4.5
tron 2005-02-13 08:12:03 +00:00
parent ac6857ee28
commit 58c46bed40
2 changed files with 17 additions and 10 deletions

View File

@ -147,10 +147,11 @@ static void ReadSpriteHeaderSkipData(int num, int load_index)
} }
} }
static void ReadSprite(SpriteID id, byte *dest) static void ReadSprite(SpriteID id, void *buffer)
{ {
uint num = _sprite_size[id]; uint num = _sprite_size[id];
byte type; byte type;
byte* dest;
FioSeekToFile(_sprite_file_pos[id]); FioSeekToFile(_sprite_file_pos[id]);
@ -158,7 +159,7 @@ static void ReadSprite(SpriteID id, byte *dest)
/* We've decoded special sprites when reading headers. */ /* We've decoded special sprites when reading headers. */
if (type != 0xFF) { if (type != 0xFF) {
/* read sprite hdr */ /* read sprite hdr */
Sprite* sprite = dest; Sprite* sprite = buffer;
sprite->info = type; sprite->info = type;
sprite->height = FioReadByte(); sprite->height = FioReadByte();
if (id == 142) sprite->height = 10; // Compensate for a TTD bug if (id == 142) sprite->height = 10; // Compensate for a TTD bug
@ -167,6 +168,8 @@ static void ReadSprite(SpriteID id, byte *dest)
sprite->y_offs = FioReadWord(); sprite->y_offs = FioReadWord();
dest = sprite->data; dest = sprite->data;
num -= 8; num -= 8;
} else {
dest = buffer;
} }
if (type & 2) { if (type & 2) {
@ -680,12 +683,7 @@ static uint RotateSprite(uint s)
} }
#endif #endif
const Sprite *GetSprite(SpriteID sprite) const void *GetRawSprite(SpriteID sprite)
{
return GetNonSprite(sprite);
}
const byte *GetNonSprite(SpriteID sprite)
{ {
byte *p; byte *p;

View File

@ -17,8 +17,17 @@ typedef struct {
} SpriteDimension; } SpriteDimension;
const SpriteDimension *GetSpriteDimension(SpriteID sprite); const SpriteDimension *GetSpriteDimension(SpriteID sprite);
const Sprite *GetSprite(SpriteID sprite); const void *GetRawSprite(SpriteID sprite);
const byte *GetNonSprite(SpriteID sprite);
static inline const Sprite *GetSprite(SpriteID sprite)
{
return GetRawSprite(sprite);
}
static inline const byte *GetNonSprite(SpriteID sprite)
{
return GetRawSprite(sprite);
}
void GfxLoadSprites(void); void GfxLoadSprites(void);
void IncreaseSpriteLRU(void); void IncreaseSpriteLRU(void);