mirror of
https://frontier.innolan.net/github/AmigaExamples.git
synced 2026-09-13 04:05:50 +00:00
Changes to imagecon to support dual playfield
This commit is contained in:
@@ -18,7 +18,8 @@ imagecon_config_t config = {
|
|||||||
.slicedHam = 0,
|
.slicedHam = 0,
|
||||||
.quantize = 0,
|
.quantize = 0,
|
||||||
.dither = 0,
|
.dither = 0,
|
||||||
.overridePalette = 0
|
.overridePalette = 0,
|
||||||
|
.paletteOffset = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -43,6 +44,7 @@ usage()
|
|||||||
" --sliced-ham\n"\
|
" --sliced-ham\n"\
|
||||||
" --dither\n"\
|
" --dither\n"\
|
||||||
" --use-palette <palette file>\n"\
|
" --use-palette <palette file>\n"\
|
||||||
|
" --palette-offset <index>\n"\
|
||||||
" --verbose\n", config.argv[0]);
|
" --verbose\n", config.argv[0]);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@@ -478,6 +480,7 @@ main(int argc, char **argv)
|
|||||||
{"sliced-ham", no_argument, &config.slicedHam, 1},
|
{"sliced-ham", no_argument, &config.slicedHam, 1},
|
||||||
{"dither", no_argument, &config.dither, 1},
|
{"dither", no_argument, &config.dither, 1},
|
||||||
{"use-palette", required_argument, 0, 'p'},
|
{"use-palette", required_argument, 0, 'p'},
|
||||||
|
{"palette-offset", required_argument, 0, 'l'},
|
||||||
{"output", required_argument, 0, 'o'},
|
{"output", required_argument, 0, 'o'},
|
||||||
{"colors", required_argument, 0, 'c'},
|
{"colors", required_argument, 0, 'c'},
|
||||||
{"input", required_argument, 0, 'i'},
|
{"input", required_argument, 0, 'i'},
|
||||||
@@ -503,6 +506,11 @@ main(int argc, char **argv)
|
|||||||
case 'p':
|
case 'p':
|
||||||
config.overridePalette = optarg;
|
config.overridePalette = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'l':
|
||||||
|
if (sscanf(optarg, "%d", &config.paletteOffset) != 1) {
|
||||||
|
abort_("invalid palette offset");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
if (sscanf(optarg, "%d", &config.maxColors) != 1) {
|
if (sscanf(optarg, "%d", &config.maxColors) != 1) {
|
||||||
abort_("invalid number of colors");
|
abort_("invalid number of colors");
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ typedef struct {
|
|||||||
int slicedHam;
|
int slicedHam;
|
||||||
int dither;
|
int dither;
|
||||||
char* overridePalette;
|
char* overridePalette;
|
||||||
|
int paletteOffset;
|
||||||
int quantize;
|
int quantize;
|
||||||
int verbose;
|
int verbose;
|
||||||
char** argv;
|
char** argv;
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ palette_output(imagecon_image_t* ic, char* outFilename)
|
|||||||
fprintf(paletteFP, "%03x\n", RGB24TORGB12(ic->palette[i].r) << 8 | RGB24TORGB12(ic->palette[i].g) << 4 | RGB24TORGB12(ic->palette[i].b));
|
fprintf(paletteFP, "%03x\n", RGB24TORGB12(ic->palette[i].r) << 8 | RGB24TORGB12(ic->palette[i].g) << 4 | RGB24TORGB12(ic->palette[i].b));
|
||||||
}
|
}
|
||||||
if (paletteAsmFP) {
|
if (paletteAsmFP) {
|
||||||
fprintf(paletteAsmFP, "\tlea COLOR%02d(a6),a0\n\tmove.w #$%03x,(a0)\n", i, RGB24TORGB12(ic->palette[i].r) << 8 | RGB24TORGB12(ic->palette[i].g) << 4 | RGB24TORGB12(ic->palette[i].b));
|
fprintf(paletteAsmFP, "\tlea COLOR%02d(a6),a0\n\tmove.w #$%03x,(a0)\n", i+config.paletteOffset, RGB24TORGB12(ic->palette[i].r) << 8 | RGB24TORGB12(ic->palette[i].g) << 4 | RGB24TORGB12(ic->palette[i].b));
|
||||||
}
|
}
|
||||||
if (paletteGreyFP) {
|
if (paletteGreyFP) {
|
||||||
// TODO: this is for compat, can be better
|
// TODO: this is for compat, can be better
|
||||||
|
|||||||
Reference in New Issue
Block a user