Mercurial > hg > dmlib
comparison tools/64vw.c @ 2223:5477e792def3
Remove useless DMC64ImageFormat parameter from some conversion functions.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 14 Jun 2019 12:12:19 +0300 |
parents | b1e392da8346 |
children | a36c81c3df85 |
comparison
equal
deleted
inserted
replaced
2222:75b5bb490f38 | 2223:5477e792def3 |
---|---|
223 dmFree(dataBuf); | 223 dmFree(dataBuf); |
224 return ret; | 224 return ret; |
225 } | 225 } |
226 | 226 |
227 | 227 |
228 int dmDecodeC64Image(DMC64Image *cimage, const DMC64ImageFormat *fmt, | 228 int dmDecodeC64Image(DMC64Image *cimage, SDL_Surface *surf, const DMC64ImageConvSpec *spec) |
229 SDL_Surface *surf, const DMC64ImageConvSpec *spec) | |
230 { | 229 { |
231 DMImage bmap; | 230 DMImage bmap; |
232 BOOL charDataSet; | 231 BOOL charDataSet; |
233 int res; | 232 int res; |
234 | 233 |
251 charDataSet = TRUE; | 250 charDataSet = TRUE; |
252 } | 251 } |
253 else | 252 else |
254 charDataSet = FALSE; | 253 charDataSet = FALSE; |
255 | 254 |
256 if (fmt->format->convertFrom != NULL) | 255 if (cimage->fmt->convertFrom != NULL) |
257 res = fmt->format->convertFrom(&bmap, cimage, fmt, spec); | 256 res = cimage->fmt->convertFrom(&bmap, cimage, spec); |
258 else | 257 else |
259 res = dmC64ConvertGenericBMP2Image(&bmap, cimage, fmt, spec); | 258 res = dmC64ConvertGenericBMP2Image(&bmap, cimage, spec); |
260 | 259 |
261 if (charDataSet) | 260 if (charDataSet) |
262 memset(&cimage->charData[0], 0, sizeof(DMC64MemBlock)); | 261 memset(&cimage->charData[0], 0, sizeof(DMC64MemBlock)); |
263 | 262 |
264 SDL_SetPaletteColors(surf->format->palette, (SDL_Color *) bmap.pal->colors, 0, bmap.pal->ncolors); | 263 SDL_SetPaletteColors(surf->format->palette, (SDL_Color *) bmap.pal->colors, 0, bmap.pal->ncolors); |
588 dmC64ImageFree(cimage); | 587 dmC64ImageFree(cimage); |
589 dmErrorMsg("Could not allocate surface.\n"); | 588 dmErrorMsg("Could not allocate surface.\n"); |
590 goto exit; | 589 goto exit; |
591 } | 590 } |
592 | 591 |
593 if (dmDecodeC64Image(cimage, fmt, surf, &optSpec) == DMERR_OK) | 592 if (dmDecodeC64Image(cimage, surf, &optSpec) == DMERR_OK) |
594 { | 593 { |
595 title = dm_strdup_printf("%s - [%d / %d] %s (%dx%d @ %s)", | 594 title = dm_strdup_printf("%s - [%d / %d] %s (%dx%d @ %s)", |
596 dmProgName, | 595 dmProgName, |
597 currIndex + 1, | 596 currIndex + 1, |
598 noptFilenames2, | 597 noptFilenames2, |