Mercurial > hg > dmlib
diff tools/64vw.c @ 2224:a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
decode functions for it.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 14 Jun 2019 12:13:23 +0300 |
parents | 5477e792def3 |
children | ccbb6149ddf0 |
line wrap: on
line diff
--- a/tools/64vw.c Fri Jun 14 12:12:19 2019 +0300 +++ b/tools/64vw.c Fri Jun 14 12:13:23 2019 +0300 @@ -228,7 +228,7 @@ int dmDecodeC64Image(DMC64Image *cimage, SDL_Surface *surf, const DMC64ImageConvSpec *spec) { DMImage bmap; - BOOL charDataSet; + BOOL charDataSet, mixedPalette; int res; memset(&bmap, 0, sizeof(bmap)); @@ -237,8 +237,9 @@ bmap.pitch = surf->pitch; bmap.width = surf->w; bmap.height = surf->h; - - if ((res = dmPaletteCopy(&bmap.pal, spec->pal)) != DMERR_OK) + + mixedPalette = (cimage->fmt->type & D64_FMT_ILACE) && cimage->laceType == D64_ILACE_COLOR; + if ((res = dmC64SetImagePalette(&bmap, spec, mixedPalette)) != DMERR_OK) { dmErrorMsg("Could not create copy of palette.\n"); return res;