Mercurial > hg > dmlib
diff tools/gfxconv.c @ 1457:dcff9ac95d3f
Add function to set DMImage's palette to default C64 palette and use it.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 10 May 2018 19:58:52 +0300 |
parents | 260c413304f3 |
children | 73e00bf7531c |
line wrap: on
line diff
--- a/tools/gfxconv.c Thu May 10 18:53:42 2018 +0300 +++ b/tools/gfxconv.c Thu May 10 19:58:52 2018 +0300 @@ -1525,10 +1525,7 @@ outImage = dmImageAlloc(outWidthPX * outIWidth, outIHeight * outHeight, DM_IFMT_PALETTE, -1); } - outImage->constpal = TRUE; - outImage->pal = dmDefaultC64Palette; - outImage->ncolors = C64_NCOLORS; - outImage->ctransp = 255; + dmSetDefaultC64Palette(outImage); while (!feof(inFile) && (optItemCount < 0 || itemCount < optItemCount)) { @@ -1775,6 +1772,7 @@ goto error; } + dmSetDefaultC64Palette(outImage); res = dmWriteImage(optOutFilename, outImage, &optSpec, optOutSubFormat, TRUE); break; @@ -1792,6 +1790,7 @@ goto error; } + dmSetDefaultC64Palette(outImage); res = dmWriteSpritesAndChars(optOutFilename, outImage, optOutFormat, optInMulticolor); break;