(svn r2522) Reorganize sprite load and decompression in order to remove a special case from the sprite blitter, which decompressed certain sprites every time when blitting them

This commit is contained in:
tron
2005-07-05 19:54:35 +00:00
parent b29556e6b5
commit a06b2fdc44
3 changed files with 36 additions and 74 deletions

32
gfx.c
View File

@@ -1376,38 +1376,6 @@ static void GfxMainBlitter(const Sprite* sprite, int x, int y, int mode)
}
bp.start_x = start_x;
if (info&2) {
int totpix = bp.height_org * bp.width_org;
byte *dst = (byte*)alloca(totpix);
const byte *src = bp.sprite_org;
bp.sprite = dst + (bp.sprite - bp.sprite_org);
while (totpix != 0) {
signed char b;
assert(totpix > 0);
b = *src++;
if (b >= 0) {
uint count = b;
uint i;
for (i = 0; i != count; i++) dst[i] = src[i];
dst += count;
src += count;
totpix -= count;
} else {
const byte *tmp = dst - (((b & 7) << 8) | *src++);
uint count = -(b >> 3);
uint i;
for (i = 0; i != count; i++) dst[i] = tmp[i];
dst += count;
totpix -= count;
}
}
}
zf_uncomp[dpi->zoom](&bp);
}
}