# HG changeset patch # User Matti Hamalainen # Date 1700358845 -7200 # Node ID ee6225ed27ec040b62d0b18246f53930a26ab733 # Parent 669b71e8b86882257063ec9f4364897e5eb4ebec Rename some variables. diff -r 669b71e8b868 -r ee6225ed27ec tools/lib64fmts.c --- a/tools/lib64fmts.c Thu Aug 03 09:07:10 2023 +0300 +++ b/tools/lib64fmts.c Sun Nov 19 03:54:05 2023 +0200 @@ -1782,11 +1782,11 @@ const DMC64Image *img, const int rasterX, const int rasterY) { DM_C64_GENERIC_SC_PIXEL_DEFS(img) - const int spr_y = rasterY / D64_SPR_HEIGHT_PX; - const int spr_yd = rasterY % D64_SPR_HEIGHT_PX; - const int spr_x = rasterX / D64_SPR_WIDTH_PX; - const int spr_xd = (rasterX % D64_SPR_WIDTH_PX) / 8; - const int offs = (spr_y * 8 + spr_x) * D64_SPR_SIZE + (spr_yd * D64_SPR_WIDTH_UT) + spr_xd; + const int sprY = rasterY / D64_SPR_HEIGHT_PX; + const int sprYD = rasterY % D64_SPR_HEIGHT_PX; + const int sprX = rasterX / D64_SPR_WIDTH_PX; + const int sprXD = (rasterX % D64_SPR_WIDTH_PX) / 8; + const int offs = (sprY * 8 + sprX) * D64_SPR_SIZE + (sprYD * D64_SPR_WIDTH_UT) + sprXD; const int mask = 1 << (7 - (rasterX & 7)); int res; @@ -2002,9 +2002,9 @@ static int fmtGetSpritePixelCrestSHFLI(DMC64ScanLine *scan, const DMC64Image *img, const int sindex, const int cindex, - const int spr_xd, const int spr_yd, const int mask) + const int sprXD, const int sprYD, const int mask) { - const size_t offs = sindex * D64_SPR_SIZE + (D64_SPR_WIDTH_UT * spr_yd) + spr_xd; + const size_t offs = sindex * D64_SPR_SIZE + (D64_SPR_WIDTH_UT * sprYD) + sprXD; if (offs >= img->extraData[14].size) return DMERR_BOUNDS; @@ -2041,20 +2041,20 @@ const int localX = rasterX - sprOffsetX, localY = rasterY - sprOffsetY; const int sbank = localY & 7; - const int spr_yd = localY % D64_SPR_HEIGHT_PX; - const int spr_x = localX / D64_SPR_WIDTH_PX; - const int spr_xd = (localX % D64_SPR_WIDTH_PX) / 8; + const int sprYD = localY % D64_SPR_HEIGHT_PX; + const int sprX = localX / D64_SPR_WIDTH_PX; + const int sprXD = (localX % D64_SPR_WIDTH_PX) / 8; const int mask = 1 << (7 - (localX & 7)); - const int spr_offs = spr_x & 3; - const int spr_index1 = img->extraData[sbank].data[spr_offs]; - const int spr_index2 = img->extraData[sbank].data[spr_offs + 4]; - - if ((res = fmtGetSpritePixelCrestSHFLI(scan, img, spr_index1, 0, spr_xd, spr_yd, mask)) == DMERR_OK || + const int sprOffs = sprX & 3; + const int sprIndex1 = img->extraData[sbank].data[sprOffs]; + const int sprIndex2 = img->extraData[sbank].data[sprOffs + 4]; + + if ((res = fmtGetSpritePixelCrestSHFLI(scan, img, sprIndex1, 0, sprXD, sprYD, mask)) == DMERR_OK || res != -1) return res; - if ((res = fmtGetSpritePixelCrestSHFLI(scan, img, spr_index2, 1, spr_xd, spr_yd, mask)) == DMERR_OK || + if ((res = fmtGetSpritePixelCrestSHFLI(scan, img, sprIndex2, 1, sprXD, sprYD, mask)) == DMERR_OK || res != -1) return res; }