diff options
author | Sierraffinity <sierra@domoreaweso.me> | 2020-04-22 14:39:20 -0700 |
---|---|---|
committer | Sierraffinity <sierra@domoreaweso.me> | 2020-04-22 14:39:20 -0700 |
commit | 21e9ed66158f1def9aea98eb09ecdf0f3aa4b202 (patch) | |
tree | 039dc031d0f56789f1dd31da2cc74dce39dde50c /tools/gbagfx/util.c | |
parent | 922a8de78d465e43b4fb2d26938e9cddc62386d6 (diff) |
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 using only file extension as output to reuse entire path from input before extension
Diffstat (limited to 'tools/gbagfx/util.c')
-rw-r--r-- | tools/gbagfx/util.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |