1
0
Fork 0

(svn r6302) -Codechange: Remove dead code paths, because the lowest bit of Sprite::info is never unset

release/0.5
tron 2006-09-02 07:13:21 +00:00
parent dcc25abeec
commit 2890ed33b8
1 changed files with 83 additions and 105 deletions

48
gfx.c
View File

@ -663,7 +663,6 @@ typedef struct BlitterParams {
int width_org;
int height_org;
int pitch;
byte info;
} BlitterParams;
static void GfxBlitTileZoomIn(BlitterParams *bp)
@ -813,8 +812,7 @@ static void GfxBlitZoomInUncomp(BlitterParams *bp)
assert(width > 0);
switch (bp->mode) {
case 1:
if (bp->info & 1) {
case 1: {
const byte *ctab = _color_remap_ptr;
do {
@ -826,11 +824,10 @@ static void GfxBlitZoomInUncomp(BlitterParams *bp)
src += bp->width_org;
dst += bp->pitch;
} while (--height != 0);
}
break;
}
case 2:
if (bp->info & 1) {
case 2: {
const byte *ctab = _color_remap_ptr;
do {
@ -839,17 +836,10 @@ static void GfxBlitZoomInUncomp(BlitterParams *bp)
src += bp->width_org;
dst += bp->pitch;
} while (--height != 0);
}
break;
}
default:
if (!(bp->info & 1)) {
do {
memcpy(dst, src, width);
src += bp->width_org;
dst += bp->pitch;
} while (--height != 0);
} else {
do {
int n = width;
@ -872,7 +862,6 @@ static void GfxBlitZoomInUncomp(BlitterParams *bp)
src += bp->width_org - width;
dst += bp->pitch - width;
} while (--height != 0);
}
break;
}
}
@ -1050,8 +1039,7 @@ static void GfxBlitZoomMediumUncomp(BlitterParams *bp)
assert(width > 0);
switch (bp->mode) {
case 1:
if (bp->info & 1) {
case 1: {
const byte *ctab = _color_remap_ptr;
for (height >>= 1; height != 0; height--) {
@ -1063,11 +1051,10 @@ static void GfxBlitZoomMediumUncomp(BlitterParams *bp)
src += bp->width_org * 2;
dst += bp->pitch;
}
}
break;
}
case 2:
if (bp->info & 1) {
case 2: {
const byte *ctab = _color_remap_ptr;
for (height >>= 1; height != 0; height--) {
@ -1076,18 +1063,16 @@ static void GfxBlitZoomMediumUncomp(BlitterParams *bp)
src += bp->width_org * 2;
dst += bp->pitch;
}
}
break;
}
default:
if (bp->info & 1) {
for (height >>= 1; height != 0; height--) {
for (i = 0; i != width >> 1; i++)
if (src[i * 2] != 0) dst[i] = src[i * 2];
src += bp->width_org * 2;
dst += bp->pitch;
}
}
break;
}
}
@ -1324,8 +1309,7 @@ static void GfxBlitZoomOutUncomp(BlitterParams *bp)
assert(width > 0);
switch (bp->mode) {
case 1:
if (bp->info & 1) {
case 1: {
const byte *ctab = _color_remap_ptr;
for (height >>= 2; height != 0; height--) {
@ -1337,11 +1321,10 @@ static void GfxBlitZoomOutUncomp(BlitterParams *bp)
src += bp->width_org * 4;
dst += bp->pitch;
}
}
break;
}
case 2:
if (bp->info & 1) {
case 2: {
const byte *ctab = _color_remap_ptr;
for (height >>= 2; height != 0; height--) {
@ -1350,18 +1333,16 @@ static void GfxBlitZoomOutUncomp(BlitterParams *bp)
src += bp->width_org * 4;
dst += bp->pitch;
}
}
break;
}
default:
if (bp->info & 1) {
for (height >>= 2; height != 0; height--) {
for (i = 0; i != width >> 2; i++)
if (src[i * 4] != 0) dst[i] = src[i * 4];
src += bp->width_org * 4;
dst += bp->pitch;
}
}
break;
}
}
@ -1371,7 +1352,6 @@ static void GfxMainBlitter(const Sprite *sprite, int x, int y, int mode)
{
const DrawPixelInfo *dpi = _cur_dpi;
int start_x, start_y;
byte info;
BlitterParams bp;
int zoom_mask = ~((1 << dpi->zoom) - 1);
@ -1380,8 +1360,6 @@ static void GfxMainBlitter(const Sprite *sprite, int x, int y, int mode)
y += sprite->y_offs;
bp.width_org = bp.width = sprite->width;
bp.height_org = bp.height = sprite->height;
info = sprite->info;
bp.info = info;
bp.sprite_org = bp.sprite = sprite->data;
bp.dst = dpi->dst_ptr;
bp.mode = mode;
@ -1390,7 +1368,7 @@ static void GfxMainBlitter(const Sprite *sprite, int x, int y, int mode)
assert(bp.height > 0);
assert(bp.width > 0);
if (info & 8) {
if (sprite->info & 8) {
/* tile blit */
start_y = 0;