@@ -164,49 +164,49 @@ static void* ReadSprite(SpriteID id)
id
);
}
FioSeekToFile(_sprite_file_pos[id]);
type = FioReadByte();
if (type == 0xFF) {
byte* dest = AllocSprite(num);
_sprite_ptr[id] = dest;
FioReadBlock(dest, num);
return dest;
} else {
uint height = FioReadByte();
uint width = FioReadWord();
Sprite* sprite;
byte* dest;
num = (type & 0x02) ? width * height : num - 8;
sprite = AllocSprite(sizeof(*sprite) + num);
_sprite_ptr[id] = sprite;
sprite->info = type;
sprite->height = (id != 142) ? height : 10;
sprite->height = (id != 142) ? height : 10; // Compensate for a TTD bug
sprite->width = width;
sprite->x_offs = FioReadWord();
sprite->y_offs = FioReadWord();
dest = sprite->data;
while (num > 0) {
int8 i = FioReadByte();
if (i >= 0) {
num -= i;
for (; i > 0; --i) *dest++ = FioReadByte();
const byte* rel = dest - (((i & 7) << 8) | FioReadByte());
i = -(i >> 3);
for (; i > 0; --i) *dest++ = *rel++;
return sprite;