diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/nitrogfx/gfx.c | 8 | ||||
-rw-r--r-- | tools/nitrogfx/gfx.h | 2 | ||||
-rw-r--r-- | tools/nitrogfx/main.c | 14 |
3 files changed, 20 insertions, 4 deletions
diff --git a/tools/nitrogfx/gfx.c b/tools/nitrogfx/gfx.c index a80d341b..0acb4133 100644 --- a/tools/nitrogfx/gfx.c +++ b/tools/nitrogfx/gfx.c @@ -534,7 +534,7 @@ void WriteGbaPalette(char *path, struct Palette *palette) fclose(fp); } -void WriteNtrPalette(char *path, struct Palette *palette, bool ncpr) +void WriteNtrPalette(char *path, struct Palette *palette, bool ncpr, bool ir) { FILE *fp = fopen(path, "wb"); @@ -594,6 +594,12 @@ void WriteNtrPalette(char *path, struct Palette *palette, bool ncpr) } } + if (ir) + { + colours[510] = 'I'; + colours[511] = 'R'; + } + fwrite(colours, 1, 256 * 2, fp); fclose(fp); diff --git a/tools/nitrogfx/gfx.h b/tools/nitrogfx/gfx.h index 1b097336..ef7926d1 100644 --- a/tools/nitrogfx/gfx.h +++ b/tools/nitrogfx/gfx.h @@ -36,6 +36,6 @@ void FreeImage(struct Image *image); void ReadGbaPalette(char *path, struct Palette *palette); void ReadNtrPalette(char *path, struct Palette *palette); void WriteGbaPalette(char *path, struct Palette *palette); -void WriteNtrPalette(char *path, struct Palette *palette, bool ncpr); +void WriteNtrPalette(char *path, struct Palette *palette, bool ncpr, bool ir); #endif // GFX_H diff --git a/tools/nitrogfx/main.c b/tools/nitrogfx/main.c index 076e7076..b922e4b2 100644 --- a/tools/nitrogfx/main.c +++ b/tools/nitrogfx/main.c @@ -411,6 +411,7 @@ void HandlePngToNtrPaletteCommand(char *inputPath, char *outputPath, int argc, c { struct Palette palette; bool ncpr = false; + bool ir = false; for (int i = 3; i < argc; i++) { @@ -420,6 +421,10 @@ void HandlePngToNtrPaletteCommand(char *inputPath, char *outputPath, int argc, c { ncpr = true; } + else if (strcmp(option, "-ir") == 0) + { + ir = true; + } else { FATAL_ERROR("Unrecognized option \"%s\".\n", option); @@ -427,7 +432,7 @@ void HandlePngToNtrPaletteCommand(char *inputPath, char *outputPath, int argc, c } ReadPngPalette(inputPath, &palette); - WriteNtrPalette(outputPath, &palette, ncpr); + WriteNtrPalette(outputPath, &palette, ncpr, ir); } void HandleGbaToJascPaletteCommand(char *inputPath, char *outputPath, int argc UNUSED, char **argv UNUSED) @@ -487,6 +492,7 @@ void HandleJascToNtrPaletteCommand(char *inputPath, char *outputPath, int argc, { int numColors = 0; bool ncpr = false; + bool ir = false; for (int i = 3; i < argc; i++) { @@ -509,6 +515,10 @@ void HandleJascToNtrPaletteCommand(char *inputPath, char *outputPath, int argc, { ncpr = true; } + else if (strcmp(option, "-ir") == 0) + { + ir = true; + } else { FATAL_ERROR("Unrecognized option \"%s\".\n", option); @@ -522,7 +532,7 @@ void HandleJascToNtrPaletteCommand(char *inputPath, char *outputPath, int argc, if (numColors != 0) palette.numColors = numColors; - WriteNtrPalette(outputPath, &palette, ncpr); + WriteNtrPalette(outputPath, &palette, ncpr, ir); } void HandleLatinFontToPngCommand(char *inputPath, char *outputPath, int argc UNUSED, char **argv UNUSED) |