From 8c1d0d77a535cf2587300d8ca1741c47c9a3c5f9 Mon Sep 17 00:00:00 2001 From: Sierraffinity Date: Wed, 22 Apr 2020 15:06:34 -0700 Subject: gbagfx: Various fixes and improvements Fix num_colors exceeding amount of colors in palette leading to use of uninitialized colors Handle png -> pal conversion (aka extracting JASC palettes from png) Allow JASC pal files to be used as -palette argument when converting from GBA to PNG Allow using only file extension as output to reuse entire path from input before extension --- tools/gbagfx/util.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools/gbagfx/util.c') diff --git a/tools/gbagfx/util.c b/tools/gbagfx/util.c index 87abeb31c..735037692 100644 --- a/tools/gbagfx/util.c +++ b/tools/gbagfx/util.c @@ -47,6 +47,13 @@ char *GetFileExtension(char *path) while (extension > path && *extension != '.') extension--; + return extension; +} + +char *GetFileExtensionAfterDot(char *path) +{ + char *extension = GetFileExtension(path); + if (extension == path) return NULL; -- cgit v1.2.3