Mercurial > hg > dmlib
changeset 1849:914dbb50139f
Rename "FunPaint II" to "Fun Painter II" as it should be.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 22 Jun 2018 23:06:32 +0300 |
parents | 273e274f9ed6 |
children | 3d6917948061 |
files | tools/lib64fmts.c |
diffstat | 1 files changed, 23 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/lib64fmts.c Fri Jun 22 22:39:12 2018 +0300 +++ b/tools/lib64fmts.c Fri Jun 22 23:06:32 2018 +0300 @@ -711,15 +711,17 @@ } -#define FUNPAINT2_HEADER_SIZE (0x10) -static const char *fmtFunPaint2MagicID = "FUNPAINT (MT) "; -static int fmtProbeFunPaint2(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) +#define FUNPAINTER2_HEADER_SIZE (0x10) +static const char *fmtFunPainter2MagicID = "FUNPAINT (MT) "; + + +static int fmtProbeFunPainter2(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) { if (buf->len > 30 && dmCompareAddr16(buf, 0, fmt->addr) && - memcmp(buf->data + 2, fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) == 0) + memcmp(buf->data + 2, fmtFunPainter2MagicID, strlen(fmtFunPainter2MagicID)) == 0) { // Unpacked variant if (fmt->size != 0 && buf->data[14 + 2] == 0) @@ -734,7 +736,7 @@ } -static int fmtDecodeFunPaint2(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt) +static int fmtDecodeFunPainter2(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt) { int res; DMGrowBuf tmp; @@ -750,7 +752,7 @@ cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; cfg.rleMarkerB = buf->data[15]; - dmGrowBufCopyOffs(&tmp, buf, FUNPAINT2_HEADER_SIZE, 1); + dmGrowBufCopyOffs(&tmp, buf, FUNPAINTER2_HEADER_SIZE, 1); tmp.len = tmp.size; if ((res = dmDecodeGenericRLEAlloc( @@ -762,17 +764,17 @@ } else { - res = dmC64DecodeGenericBMP(img, dmGrowBufConstCopyOffs(&tmp, buf, FUNPAINT2_HEADER_SIZE), fmt); + res = dmC64DecodeGenericBMP(img, dmGrowBufConstCopyOffs(&tmp, buf, FUNPAINTER2_HEADER_SIZE), fmt); } return res; } -static int fmtEncodeFunPaint2Unpacked(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) +static int fmtEncodeFunPainter2Unpacked(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) { // Add the header bits - if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) || + if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPainter2MagicID, strlen(fmtFunPainter2MagicID)) || !dmGrowBufPutU8(buf, 0) || // 0 == unpacked variant !dmGrowBufPutU8(buf, 0)) // RLE marker byte (not used in unpacked) return DMERR_MALLOC; @@ -781,7 +783,7 @@ } -static int fmtEncodeFunPaint2Packed(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) +static int fmtEncodeFunPainter2Packed(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) { int res; DMGrowBuf mem; @@ -801,7 +803,7 @@ dmGenericRLEAnalyze(&mem, &cfg); // Add the header bits - if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) || + if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPainter2MagicID, strlen(fmtFunPainter2MagicID)) || !dmGrowBufPutU8(buf, 1) || // non-zero == packed variant !dmGrowBufPutU8(buf, cfg.rleMarkerB)) { @@ -818,7 +820,7 @@ } -static Uint8 fmtGetPixelFunPaint2( +static Uint8 fmtGetPixelFunPainter2( const DMC64Image *img, const int bmoffs, const int scroffs, const int shift, const int bitmap, const int rasterX, const int rasterY) { @@ -1022,12 +1024,12 @@ } }, - { // #3: FunPaint II + { // #3: FunPainter II D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, C64_SCR_WIDTH, C64_SCR_HEIGHT, C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, NULL, NULL, - fmtGetPixelFunPaint2, + fmtGetPixelFunPainter2, { DEF_SCREEN_RAMS_8(0x0000, 0, 0x400), { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL }, @@ -1652,16 +1654,16 @@ }, { - "fp2", "FunPaint II (unpacked)", 0x3ff0, 33694, DM_FMT_RDWR, - fmtProbeFunPaint2, - fmtDecodeFunPaint2, fmtEncodeFunPaint2Unpacked, + "fp2", "FunPainter II (unpacked)", 0x3ff0, 33694, DM_FMT_RDWR, + fmtProbeFunPainter2, + fmtDecodeFunPainter2, fmtEncodeFunPainter2Unpacked, { }, &dmC64CommonFormats[3] }, { - "fp2p", "FunPaint II (packed)", 0x3ff0, 0, DM_FMT_RDWR, - fmtProbeFunPaint2, - fmtDecodeFunPaint2, fmtEncodeFunPaint2Packed, + "fp2p", "FunPainter II (packed)", 0x3ff0, 0, DM_FMT_RDWR, + fmtProbeFunPainter2, + fmtDecodeFunPainter2, fmtEncodeFunPainter2Packed, { }, &dmC64CommonFormats[3] }, @@ -1674,7 +1676,7 @@ C64_SCR_WIDTH, C64_SCR_HEIGHT, C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, NULL, NULL, - fmtGetPixelFunPaint2, // The format is essentially same as FP2 + fmtGetPixelFunPainter2, // The format is essentially same as FP2 { DEF_SCREEN_RAMS_8(0x0000, 0, 0x400), { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL },