gfx.c
changeset 4425 f15ad32f87e5
parent 4344 7e123fec5b0b
child 4428 6d9fab57f2af
equal deleted inserted replaced
4424:bf0f71cb6e1f 4425:f15ad32f87e5
  1378 	int start_x, start_y;
  1378 	int start_x, start_y;
  1379 	byte info;
  1379 	byte info;
  1380 	BlitterParams bp;
  1380 	BlitterParams bp;
  1381 	int zoom_mask = ~((1 << dpi->zoom) - 1);
  1381 	int zoom_mask = ~((1 << dpi->zoom) - 1);
  1382 
  1382 
  1383 	static const BlitZoomFunc zf_tile[3] =
       
  1384 	{
       
  1385 		GfxBlitTileZoomIn,
       
  1386 		GfxBlitTileZoomMedium,
       
  1387 		GfxBlitTileZoomOut
       
  1388 	};
       
  1389 	static const BlitZoomFunc zf_uncomp[3] =
       
  1390 	{
       
  1391 		GfxBlitZoomInUncomp,
       
  1392 		GfxBlitZoomMediumUncomp,
       
  1393 		GfxBlitZoomOutUncomp
       
  1394 	};
       
  1395 
       
  1396 	/* decode sprite header */
  1383 	/* decode sprite header */
  1397 	x += sprite->x_offs;
  1384 	x += sprite->x_offs;
  1398 	y += sprite->y_offs;
  1385 	y += sprite->y_offs;
  1399 	bp.width_org = bp.width = sprite->width;
  1386 	bp.width_org = bp.width = sprite->width;
  1400 	bp.height_org = bp.height = sprite->height;
  1387 	bp.height_org = bp.height = sprite->height;
  1448 		if ( (x = x + bp.width - dpi->width) > 0) {
  1435 		if ( (x = x + bp.width - dpi->width) > 0) {
  1449 			bp.width -= x;
  1436 			bp.width -= x;
  1450 			if (bp.width <= 0) return;
  1437 			if (bp.width <= 0) return;
  1451 		}
  1438 		}
  1452 
  1439 
  1453 		zf_tile[dpi->zoom](&bp);
  1440 		switch (dpi->zoom) {
       
  1441 			default: NOT_REACHED();
       
  1442 			case 0: GfxBlitTileZoomIn(&bp);     break;
       
  1443 			case 1: GfxBlitTileZoomMedium(&bp); break;
       
  1444 			case 2: GfxBlitTileZoomOut(&bp);    break;
       
  1445 		}
  1454 	} else {
  1446 	} else {
  1455 		bp.sprite += bp.width * (bp.height & ~zoom_mask);
  1447 		bp.sprite += bp.width * (bp.height & ~zoom_mask);
  1456 		bp.height &= zoom_mask;
  1448 		bp.height &= zoom_mask;
  1457 		if (bp.height == 0) return;
  1449 		if (bp.height == 0) return;
  1458 
  1450 
  1485 		if (bp.width > dpi->width - x) {
  1477 		if (bp.width > dpi->width - x) {
  1486 			bp.width = dpi->width - x;
  1478 			bp.width = dpi->width - x;
  1487 			if (bp.width <= 0) return;
  1479 			if (bp.width <= 0) return;
  1488 		}
  1480 		}
  1489 
  1481 
  1490 		zf_uncomp[dpi->zoom](&bp);
  1482 		switch (dpi->zoom) {
       
  1483 			default: NOT_REACHED();
       
  1484 			case 0: GfxBlitZoomInUncomp(&bp);     break;
       
  1485 			case 1: GfxBlitZoomMediumUncomp(&bp); break;
       
  1486 			case 2: GfxBlitZoomOutUncomp(&bp);    break;
       
  1487 		}
  1491 	}
  1488 	}
  1492 }
  1489 }
  1493 
  1490 
  1494 void DoPaletteAnimations(void);
  1491 void DoPaletteAnimations(void);
  1495 
  1492