(svn r6180) Use a switch instead of function pointers to choose the blitter
authortron
Mon, 28 Aug 2006 06:05:04 +0000
changeset 4425 cff9af513dec
parent 4424 5b7aca737cfa
child 4426 291490691472
(svn r6180) Use a switch instead of function pointers to choose the blitter
gfx.c
--- a/gfx.c	Sun Aug 27 22:08:40 2006 +0000
+++ b/gfx.c	Mon Aug 28 06:05:04 2006 +0000
@@ -1380,19 +1380,6 @@
 	BlitterParams bp;
 	int zoom_mask = ~((1 << dpi->zoom) - 1);
 
-	static const BlitZoomFunc zf_tile[3] =
-	{
-		GfxBlitTileZoomIn,
-		GfxBlitTileZoomMedium,
-		GfxBlitTileZoomOut
-	};
-	static const BlitZoomFunc zf_uncomp[3] =
-	{
-		GfxBlitZoomInUncomp,
-		GfxBlitZoomMediumUncomp,
-		GfxBlitZoomOutUncomp
-	};
-
 	/* decode sprite header */
 	x += sprite->x_offs;
 	y += sprite->y_offs;
@@ -1450,7 +1437,12 @@
 			if (bp.width <= 0) return;
 		}
 
-		zf_tile[dpi->zoom](&bp);
+		switch (dpi->zoom) {
+			default: NOT_REACHED();
+			case 0: GfxBlitTileZoomIn(&bp);     break;
+			case 1: GfxBlitTileZoomMedium(&bp); break;
+			case 2: GfxBlitTileZoomOut(&bp);    break;
+		}
 	} else {
 		bp.sprite += bp.width * (bp.height & ~zoom_mask);
 		bp.height &= zoom_mask;
@@ -1487,7 +1479,12 @@
 			if (bp.width <= 0) return;
 		}
 
-		zf_uncomp[dpi->zoom](&bp);
+		switch (dpi->zoom) {
+			default: NOT_REACHED();
+			case 0: GfxBlitZoomInUncomp(&bp);     break;
+			case 1: GfxBlitZoomMediumUncomp(&bp); break;
+			case 2: GfxBlitZoomOutUncomp(&bp);    break;
+		}
 	}
 }