Mercurial > hg > dmlib
changeset 2595:ee6225ed27ec
Rename some variables.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 19 Nov 2023 03:54:05 +0200 |
parents | 669b71e8b868 |
children | 353192a5100a |
files | tools/lib64fmts.c |
diffstat | 1 files changed, 16 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- 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; }