Mercurial > hg > dmlib
changeset 1874:b386d339056f
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 24 Jun 2018 21:13:36 +0300 |
parents | 91705a2bc3a4 |
children | b052754a1a23 |
files | tools/gfxconv.c |
diffstat | 1 files changed, 19 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/gfxconv.c Sun Jun 24 20:26:39 2018 +0300 +++ b/tools/gfxconv.c Sun Jun 24 21:13:36 2018 +0300 @@ -1882,6 +1882,8 @@ switch (optOutFormat) { case FFMT_IMAGE: + case FFMT_CHAR: + case FFMT_SPRITE: res = dmC64ConvertBMP2Image(&outImage, inC64Image, inC64Fmt); if (res != DMERR_OK || outImage == NULL) @@ -1890,8 +1892,19 @@ goto error; } - res = dmWriteImage(optOutFilename, outImage, &optSpec, - &dmImageFormatList[optOutSubFormat], TRUE); + switch (optOutFormat) + { + case FFMT_IMAGE: + res = dmWriteImage(optOutFilename, outImage, &optSpec, + &dmImageFormatList[optOutSubFormat], TRUE); + break; + + case FFMT_CHAR: + case FFMT_SPRITE: + res = dmWriteSpritesAndChars(optOutFilename, outImage, + optOutFormat, optInMulticolor); + break; + } break; case FFMT_BITMAP: @@ -1909,21 +1922,8 @@ res = dmWriteBitmap(optOutFilename, outC64Image, &dmC64ImageFormats[optOutSubFormat]); break; - case FFMT_CHAR: - case FFMT_SPRITE: - res = dmC64ConvertBMP2Image(&outImage, inC64Image, inC64Fmt); - - if (res != DMERR_OK || outImage == NULL) - { - dmErrorMsg("Error in bitmap to template image conversion.\n"); - goto error; - } - - res = dmWriteSpritesAndChars(optOutFilename, outImage, optOutFormat, optInMulticolor); - break; - default: - dmErrorMsg("Unsupported output format for bitmap/image conversion.\n"); + dmErrorMsg("Unsupported output format for bitmap conversion.\n"); break; } @@ -1954,12 +1954,12 @@ if (ifmt->readFILE != NULL) res = ifmt->readFILE(fp, &inImage); else - dmErrorMsg("Unsupported input image format for bitmap/image conversion.\n"); + dmErrorMsg("Unsupported input image format for image conversion.\n"); dmf_close(fp); if (res != DMERR_OK || inImage == NULL) - break; + goto error; switch (optOutFormat) { @@ -1974,7 +1974,7 @@ break; default: - dmErrorMsg("Unsupported output format for bitmap/image conversion.\n"); + dmErrorMsg("Unsupported output format for image conversion.\n"); break; }