# HG changeset patch # User Matti Hamalainen # Date 1405262560 -10800 # Node ID 5333dd4a99e4e43acf0b6dc1d57cd148aa33699e # Parent 85442780089f8fd714d80cbec5c555e37e53465c Cosmetics. diff -r 85442780089f -r 5333dd4a99e4 tools/gfxconv.c --- a/tools/gfxconv.c Sun Jul 13 17:41:47 2014 +0300 +++ b/tools/gfxconv.c Sun Jul 13 17:42:40 2014 +0300 @@ -12,13 +12,13 @@ #include "libgfx.h" #include "lib64gfx.h" -//#define UNFINISHED 1 #define DM_MAX_COLORS 256 -#define ASC_NBITS 8 -#define ASC_NCOLORS 4 -static const char dmASCIIPalette[ASC_NCOLORS] = ".:X#"; +#define DM_ASC_NBITS 8 +#define DM_ASC_NCOLORS 4 +static const char dmASCIIPalette[DM_ASC_NCOLORS] = ".:X#"; + enum { @@ -110,6 +110,7 @@ char *optInFilename = NULL, *optOutFilename = NULL; + int optInFormat = FFMT_AUTO, optOutFormat = FFMT_ASCII, optInSubFormat = IMGFMT_PNG, @@ -207,6 +208,7 @@ dmArgsPrintHelp(stdout, optList, optListN); printf( + "\n" "Palette / color remapping (-R)\n" "------------------------------\n" "Indexed palette/color remapping can be performed via the -R option, either\n" @@ -232,6 +234,7 @@ "The numbers are palette indexes, and the order is for bit(pair)-values\n" "00, 01, 10, 11 (multi color) and 0, 1 (single color). NOTICE! 255 is the\n" "special color that can be used for transparency.\n" + "\n" ); } @@ -684,7 +687,7 @@ if (multicolor) { - for (i = ASC_NBITS; i; i -= 2) + for (i = DM_ASC_NBITS; i; i -= 2) { int val = (byte & (3ULL << (i - 2))) >> (i - 2); char ch; @@ -706,7 +709,7 @@ } else { - for (i = ASC_NBITS; i; i--) + for (i = DM_ASC_NBITS; i; i--) { int val = (byte & (1ULL << (i - 1))) >> (i - 1); char ch;