# HG changeset patch # User Matti Hamalainen # Date 1560503539 -10800 # Node ID 5477e792def35dcf663f7342ef127a0205962ed9 # Parent 75b5bb490f38f4210fb0ada5bc68ad5318632501 Remove useless DMC64ImageFormat parameter from some conversion functions. diff -r 75b5bb490f38 -r 5477e792def3 tools/64vw.c --- a/tools/64vw.c Fri Jun 14 12:08:59 2019 +0300 +++ b/tools/64vw.c Fri Jun 14 12:12:19 2019 +0300 @@ -225,8 +225,7 @@ } -int dmDecodeC64Image(DMC64Image *cimage, const DMC64ImageFormat *fmt, - SDL_Surface *surf, const DMC64ImageConvSpec *spec) +int dmDecodeC64Image(DMC64Image *cimage, SDL_Surface *surf, const DMC64ImageConvSpec *spec) { DMImage bmap; BOOL charDataSet; @@ -253,10 +252,10 @@ else charDataSet = FALSE; - if (fmt->format->convertFrom != NULL) - res = fmt->format->convertFrom(&bmap, cimage, fmt, spec); + if (cimage->fmt->convertFrom != NULL) + res = cimage->fmt->convertFrom(&bmap, cimage, spec); else - res = dmC64ConvertGenericBMP2Image(&bmap, cimage, fmt, spec); + res = dmC64ConvertGenericBMP2Image(&bmap, cimage, spec); if (charDataSet) memset(&cimage->charData[0], 0, sizeof(DMC64MemBlock)); @@ -590,7 +589,7 @@ goto exit; } - if (dmDecodeC64Image(cimage, fmt, surf, &optSpec) == DMERR_OK) + if (dmDecodeC64Image(cimage, surf, &optSpec) == DMERR_OK) { title = dm_strdup_printf("%s - [%d / %d] %s (%dx%d @ %s)", dmProgName, diff -r 75b5bb490f38 -r 5477e792def3 tools/gfxconv.c --- a/tools/gfxconv.c Fri Jun 14 12:08:59 2019 +0300 +++ b/tools/gfxconv.c Fri Jun 14 12:12:19 2019 +0300 @@ -2227,7 +2227,7 @@ } // Convert the image - res = dmC64ConvertBMP2Image(&outImage, inC64Image, inC64Fmt, &optC64Spec); + res = dmC64ConvertBMP2Image(&outImage, inC64Image, &optC64Spec); if (res != DMERR_OK || outImage == NULL) { diff -r 75b5bb490f38 -r 5477e792def3 tools/lib64gfx.c --- a/tools/lib64gfx.c Fri Jun 14 12:08:59 2019 +0300 +++ b/tools/lib64gfx.c Fri Jun 14 12:12:19 2019 +0300 @@ -1382,13 +1382,12 @@ // Convert a generic "C64" format bitmap in DMC64Image struct to // a indexed/paletted bitmap image. -int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, - const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec) +int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageConvSpec *spec) { DMC64GetPixelFunc getPixel; // Sanity check arguments - if (dst == NULL || src == NULL || fmt == NULL || spec == NULL) + if (dst == NULL || src == NULL || spec == NULL) return DMERR_NULLPTR; if (dst->width != src->fmt->width || dst->height != src->fmt->height) @@ -1433,13 +1432,12 @@ } -int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, - const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec) +int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageConvSpec *spec) { int res; DMImage *dst; - if (pdst == NULL || src == NULL || fmt == NULL || spec == NULL) + if (pdst == NULL || src == NULL || spec == NULL) return DMERR_NULLPTR; // Allocate image structure @@ -1452,10 +1450,10 @@ return res; // Convert - if (fmt->format->convertFrom != NULL) - res = fmt->format->convertFrom(dst, src, fmt, spec); + if (src->fmt->convertFrom != NULL) + res = src->fmt->convertFrom(dst, src, spec); else - res = dmC64ConvertGenericBMP2Image(dst, src, fmt, spec); + res = dmC64ConvertGenericBMP2Image(dst, src, spec); return res; } diff -r 75b5bb490f38 -r 5477e792def3 tools/lib64gfx.h --- a/tools/lib64gfx.h Fri Jun 14 12:08:59 2019 +0300 +++ b/tools/lib64gfx.h Fri Jun 14 12:12:19 2019 +0300 @@ -244,7 +244,7 @@ chWidth, chHeight, // Width and height in charblocks aspectX, aspectY; // Pixel aspectX/Y - int (*convertFrom)(DMImage *, const DMC64Image *, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec); + int (*convertFrom)(DMImage *, const DMC64Image *, const DMC64ImageConvSpec *spec); int (*convertTo)(DMC64Image *, const DMImage *, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec); DMC64GetPixelFunc getPixel; @@ -383,13 +383,13 @@ int dmC64DecodeGenericBMP(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt); int dmC64EncodeGenericBMP(const BOOL allocate, DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt); -int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec); +int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageConvSpec *spec); int dmC64ConvertImage2BMP(DMC64Image **pdst, const DMImage *src, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec); int dmC64DecodeBMP(DMC64Image **img, const DMGrowBuf *buf, const size_t probeOffs, const size_t loadOffs, const DMC64ImageFormat **fmt, const DMC64ImageFormat *forced); int dmC64EncodeBMP(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt); -int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec); +int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageConvSpec *spec); int dmC64ConvertGenericImage2BMP(DMC64Image *dst, const DMImage *src, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec); void dmGenericRLEAnalyze(const DMGrowBuf *buf, DMCompParams *cfg);