Mercurial > hg > dmlib
diff tools/64vw.c @ 1931:410679d2fe8a
"Enable" the image->c64 bitmap conversion path in gfxconv. It does not work
without the necessary bits elsewhere, though. Also add DMC64ImageConvSpec
structure for delivering conversion parameters, though it is not yet used
either.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 28 Jun 2018 17:26:30 +0300 |
parents | cc4570c0bca5 |
children | 8896d5676f1b |
line wrap: on
line diff
--- a/tools/64vw.c Thu Jun 28 14:49:52 2018 +0300 +++ b/tools/64vw.c Thu Jun 28 17:26:30 2018 +0300 @@ -208,7 +208,8 @@ } -int dmDecodeC64Image(const DMC64Image *cimage, const DMC64ImageFormat *fmt, SDL_Surface *surf) +int dmDecodeC64Image(const DMC64Image *cimage, const DMC64ImageFormat *fmt, + SDL_Surface *surf, const DMC64ImageConvSpec *spec) { DMImage bmap; int ret; @@ -224,9 +225,9 @@ bmap.pal = dmDefaultC64Palette; if (fmt->format->convertFrom != NULL) - ret = fmt->format->convertFrom(&bmap, cimage, fmt); + ret = fmt->format->convertFrom(&bmap, cimage, fmt, spec); else - ret = dmC64ConvertGenericBMP2Image(&bmap, cimage, fmt); + ret = dmC64ConvertGenericBMP2Image(&bmap, cimage, fmt, spec); SDL_SetPaletteColors(surf->format->palette, (SDL_Color *) bmap.pal, 0, bmap.ncolors); @@ -236,17 +237,19 @@ int main(int argc, char *argv[]) { + const DMC64ImageFormat *forced; + DMC64ImageConvSpec spec; SDL_Window *window = NULL; SDL_Renderer *renderer = NULL; SDL_Texture *texture = NULL; SDL_Surface *surf = NULL; BOOL initSDL = FALSE, exitFlag, needRedraw; - const DMC64ImageFormat *forced; size_t currIndex, prevIndex; int ret; dmC64InitializeFormats(); dmSetScaleFactor(2.0); + memset(&spec, 0, sizeof(spec)); dmInitProg("64vw", "Display some C64 bitmap graphics formats", "0.4", NULL, NULL); @@ -468,7 +471,7 @@ goto exit; } - if (dmDecodeC64Image(cimage, fmt, surf) == DMERR_OK) + if (dmDecodeC64Image(cimage, fmt, surf, &spec) == DMERR_OK) { title = dm_strdup_printf("%s - [%d / %d] %s (%dx%d @ %s)", dmProgName,