Mercurial > hg > dmlib
diff tools/gfxconv.c @ 2125:56d4dc81774b
Rename various C64_* constants to D64_*.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 27 May 2019 08:35:35 +0300 |
parents | a17b37872d8e |
children | cffadb745484 |
line wrap: on
line diff
--- a/tools/gfxconv.c Mon May 27 08:27:01 2019 +0300 +++ b/tools/gfxconv.c Mon May 27 08:35:35 2019 +0300 @@ -133,7 +133,7 @@ int optNRemapTable = 0, optScaleMode = SCALE_AUTO; DMMapValue optRemapTable[DM_MAX_COLORS]; -int optColorMap[C64_NCOLORS]; +int optColorMap[D64_NCOLORS]; char *optCharROMFilename = NULL; @@ -740,7 +740,7 @@ { int index, ncolors; if (!dmParseMapOptionString(optArg, optColorMap, - &ncolors, C64_NCOLORS, FALSE, "color index option")) + &ncolors, D64_NCOLORS, FALSE, "color index option")) return FALSE; dmMsg(1, "Set color index mapping: "); @@ -1026,7 +1026,7 @@ void dmDumpCharASCII(FILE *outFile, const Uint8 *buf, const size_t offs, const int fmt, const BOOL multicolor) { - for (size_t yc = 0; yc < C64_CHR_HEIGHT_UT; yc++) + for (size_t yc = 0; yc < D64_CHR_HEIGHT_UT; yc++) { fprintf(outFile, "%04" DM_PRIx_SIZE_T " : ", offs + yc); dmPrintByte(outFile, buf[yc], fmt, multicolor); @@ -1039,10 +1039,10 @@ { size_t bufOffs, xc, yc; - for (bufOffs = yc = 0; yc < C64_SPR_HEIGHT_UT; yc++) + for (bufOffs = yc = 0; yc < D64_SPR_HEIGHT_UT; yc++) { fprintf(outFile, "%04" DM_PRIx_SIZE_T " ", offs + bufOffs); - for (xc = 0; xc < C64_SPR_WIDTH_UT; xc++) + for (xc = 0; xc < D64_SPR_WIDTH_UT; xc++) { dmPrintByte(outFile, buf[bufOffs], fmt, multicolor); fprintf(outFile, " "); @@ -1576,11 +1576,11 @@ int yc; if (xoffs < 0 || yoffs < 0 || - xoffs + C64_CHR_WIDTH_PX > image->width || - yoffs + C64_CHR_HEIGHT_PX > image->height) + xoffs + D64_CHR_WIDTH_PX > image->width || + yoffs + D64_CHR_HEIGHT_PX > image->height) return FALSE; - for (yc = 0; yc < C64_CHR_HEIGHT_UT; yc++) + for (yc = 0; yc < D64_CHR_HEIGHT_UT; yc++) { const Uint8 *sp = image->data + ((yc + yoffs) * image->pitch) + xoffs; buf[yc] = dmConvertByte(sp, multicolor); @@ -1596,16 +1596,16 @@ int yc, xc; if (xoffs < 0 || yoffs < 0 || - xoffs + C64_SPR_WIDTH_PX > image->width || - yoffs + C64_SPR_HEIGHT_PX > image->height) + xoffs + D64_SPR_WIDTH_PX > image->width || + yoffs + D64_SPR_HEIGHT_PX > image->height) return FALSE; - for (yc = 0; yc < C64_SPR_HEIGHT_UT; yc++) + for (yc = 0; yc < D64_SPR_HEIGHT_UT; yc++) { - for (xc = 0; xc < C64_SPR_WIDTH_PX / C64_SPR_WIDTH_UT; xc++) + for (xc = 0; xc < D64_SPR_WIDTH_PX / D64_SPR_WIDTH_UT; xc++) { const Uint8 *sp = image->data + ((yc + yoffs) * image->pitch) + (xc * 8) + xoffs; - buf[(yc * C64_SPR_WIDTH_UT) + xc] = dmConvertByte(sp, multicolor); + buf[(yc * D64_SPR_WIDTH_UT) + xc] = dmConvertByte(sp, multicolor); } } @@ -1625,16 +1625,16 @@ switch (outFormat) { case FFMT_CHAR: - outBufSize = C64_CHR_SIZE; - outBlockW = image->width / C64_CHR_WIDTH_PX; - outBlockH = image->height / C64_CHR_HEIGHT_PX; + outBufSize = D64_CHR_SIZE; + outBlockW = image->width / D64_CHR_WIDTH_PX; + outBlockH = image->height / D64_CHR_HEIGHT_PX; outType = "char"; break; case FFMT_SPRITE: - outBufSize = C64_SPR_SIZE; - outBlockW = image->width / C64_SPR_WIDTH_PX; - outBlockH = image->height / C64_SPR_HEIGHT_PX; + outBufSize = D64_SPR_SIZE; + outBlockW = image->width / D64_SPR_WIDTH_PX; + outBlockH = image->height / D64_SPR_HEIGHT_PX; outType = "sprite"; break; @@ -1677,7 +1677,7 @@ { case FFMT_CHAR: if (!dmConvertImage2Char(buf, image, - bx * C64_CHR_WIDTH_PX, by * C64_CHR_HEIGHT_PX, + bx * D64_CHR_WIDTH_PX, by * D64_CHR_HEIGHT_PX, multicolor)) { ret = DMERR_DATA_ERROR; @@ -1687,7 +1687,7 @@ case FFMT_SPRITE: if (!dmConvertImage2Sprite(buf, image, - bx * C64_SPR_WIDTH_PX, by * C64_SPR_HEIGHT_PX, + bx * D64_SPR_WIDTH_PX, by * D64_SPR_HEIGHT_PX, multicolor)) { ret = DMERR_DATA_ERROR; @@ -1725,17 +1725,17 @@ switch (optInType) { case FFMT_CHAR: - outSize = C64_CHR_SIZE; - outWidth = C64_CHR_WIDTH_UT; - outWidthPX = C64_CHR_WIDTH_PX; - outHeight = C64_CHR_HEIGHT_UT; + outSize = D64_CHR_SIZE; + outWidth = D64_CHR_WIDTH_UT; + outWidthPX = D64_CHR_WIDTH_PX; + outHeight = D64_CHR_HEIGHT_UT; break; case FFMT_SPRITE: - outSize = C64_SPR_SIZE; - outWidth = C64_SPR_WIDTH_UT; - outWidthPX = C64_SPR_WIDTH_PX; - outHeight = C64_SPR_HEIGHT_UT; + outSize = D64_SPR_SIZE; + outWidth = D64_SPR_WIDTH_UT; + outWidthPX = D64_SPR_WIDTH_PX; + outHeight = D64_SPR_HEIGHT_UT; break; default: @@ -1913,7 +1913,7 @@ int i, n, res; // Default color mapping - for (i = 0; i < C64_NCOLORS; i++) + for (i = 0; i < D64_NCOLORS; i++) optColorMap[i] = i; // Initialize c64 image conversion spec