diff options
author | red031000 <rubenru09@aol.com> | 2020-07-18 19:29:06 +0100 |
---|---|---|
committer | red031000 <rubenru09@aol.com> | 2020-07-18 19:29:06 +0100 |
commit | 8e915f8e654af9d9ea5dc94fde7012c6944ae825 (patch) | |
tree | 6b97d01e208331535e5a5092b495a938126e961b | |
parent | 68ed9752b3c1bd75f7200bb971dfc4c2b268d27a (diff) |
trainer back sprite proof of concept + fix NCLR from png
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | files/poketool/trgra/trbgra/.gitignore | 2 | ||||
-rw-r--r-- | files/poketool/trgra/trbgra/.knarcignore | 1 | ||||
-rw-r--r-- | files/poketool/trgra/trbgra/narc_0000.NCGR | bin | 6448 -> 0 bytes | |||
-rw-r--r-- | files/poketool/trgra/trbgra/narc_0000.png | bin | 0 -> 1560 bytes | |||
-rw-r--r-- | files/poketool/trgra/trbgra/narc_0000.png.key | 1 | ||||
-rw-r--r-- | files/poketool/trgra/trbgra/narc_0001.NCLR | bin | 72 -> 0 bytes | |||
-rw-r--r-- | filesystem.mk | 4 | ||||
-rw-r--r-- | graphics_rules.mk | 10 | ||||
-rw-r--r-- | tools/nitrogfx/main.c | 18 |
10 files changed, 38 insertions, 4 deletions
@@ -260,6 +260,9 @@ $(VERSION101_SOPC_8BPP_NCGR_FILES): %.NCGR: %.png $(VERSION101_SOPC_NCGR_FILES): %.NCGR: %.png $(GFX) $< $@ -version101 -sopc +$(SCANNED_NCGR_FILES): %.NCGR: %.png + $(GFX) $< $@ -scanned + %.NCLR: %.png $(GFX) $< $@ @@ -272,6 +275,9 @@ $(IR_NCLR_FILES): %.NCLR: %.pal $(4BPP_NCLR_FILES): %.NCLR: %.pal $(GFX) $< $@ -bitdepth 4 +$(8BPP_COMP10_NOPAD_NCLR_FILES): %.NCLR: %.png + $(GFX) $< $@ -bitdepth 8 -nopad -comp 10 + %.png: ; %.pal: ; diff --git a/files/poketool/trgra/trbgra/.gitignore b/files/poketool/trgra/trbgra/.gitignore new file mode 100644 index 00000000..849e6ea4 --- /dev/null +++ b/files/poketool/trgra/trbgra/.gitignore @@ -0,0 +1,2 @@ +narc_0000.NCGR +narc_0000.NCLR
\ No newline at end of file diff --git a/files/poketool/trgra/trbgra/.knarcignore b/files/poketool/trgra/trbgra/.knarcignore index 2856080a..e2f57de1 100644 --- a/files/poketool/trgra/trbgra/.knarcignore +++ b/files/poketool/trgra/trbgra/.knarcignore @@ -1,2 +1,3 @@ *.png *.pal +*.key diff --git a/files/poketool/trgra/trbgra/narc_0000.NCGR b/files/poketool/trgra/trbgra/narc_0000.NCGR Binary files differdeleted file mode 100644 index 131ae9be..00000000 --- a/files/poketool/trgra/trbgra/narc_0000.NCGR +++ /dev/null diff --git a/files/poketool/trgra/trbgra/narc_0000.png b/files/poketool/trgra/trbgra/narc_0000.png Binary files differnew file mode 100644 index 00000000..d7ba9767 --- /dev/null +++ b/files/poketool/trgra/trbgra/narc_0000.png diff --git a/files/poketool/trgra/trbgra/narc_0000.png.key b/files/poketool/trgra/trbgra/narc_0000.png.key new file mode 100644 index 00000000..44d8ba26 --- /dev/null +++ b/files/poketool/trgra/trbgra/narc_0000.png.key @@ -0,0 +1 @@ +[ü
\ No newline at end of file diff --git a/files/poketool/trgra/trbgra/narc_0001.NCLR b/files/poketool/trgra/trbgra/narc_0001.NCLR Binary files differdeleted file mode 100644 index 39767f84..00000000 --- a/files/poketool/trgra/trbgra/narc_0001.NCLR +++ /dev/null diff --git a/filesystem.mk b/filesystem.mk index 44c59cd3..d5d3cae8 100644 --- a/filesystem.mk +++ b/filesystem.mk @@ -2258,6 +2258,10 @@ files/demo/title/titledemo.narc: \ files/demo/title/titledemo/narc_0015.NCGR \ files/demo/title/titledemo/narc_0016.NCLR +files/poketool/trgra/trbgra.narc: \ + files/poketool/trgra/trbgra/narc_0000.NCGR \ + files/poketool/trgra/trbgra/narc_0000.NCLR + .PHONY: filesystem filesystem: $(HOSTFS_FILES) diff --git a/graphics_rules.mk b/graphics_rules.mk index 2a7d207b..95b55503 100644 --- a/graphics_rules.mk +++ b/graphics_rules.mk @@ -105,6 +105,10 @@ VERSION101_SOPC_NCGR_FILES := files/demo/title/titledemo/narc_0007.NCGR \ files/demo/title/titledemo/narc_0011.NCGR \ files/demo/title/titledemo/narc_0015.NCGR +8BPP_COMP10_NOPAD_NCLR_FILES := files/poketool/trgra/trbgra/narc_0000.NCLR + +SCANNED_NCGR_FILES := files/poketool/trgra/trbgra/narc_0000.NCGR + NCGR_CLEAN_LIST := files/data/cell0.NCGR \ files/demo/title/titledemo/narc_0001.NCGR \ files/demo/title/titledemo/narc_0003.NCGR \ @@ -170,7 +174,8 @@ NCGR_CLEAN_LIST := files/data/cell0.NCGR \ files/itemtool/itemdata/item_icon/narc_0133.NCGR \ files/itemtool/itemdata/item_icon/narc_0135.NCGR \ files/itemtool/itemdata/item_icon/narc_0136.NCGR \ - files/itemtool/itemdata/item_icon/narc_0138.NCGR + files/itemtool/itemdata/item_icon/narc_0138.NCGR \ + files/poketool/trgra/trbgra/narc_0000.NCGR NCLR_CLEAN_LIST := files/data/cell0.NCLR \ @@ -263,4 +268,5 @@ NCLR_CLEAN_LIST := files/data/cell0.NCLR \ files/itemtool/itemdata/item_icon/narc_0131.NCLR \ files/itemtool/itemdata/item_icon/narc_0134.NCLR \ files/itemtool/itemdata/item_icon/narc_0136.NCLR \ - files/itemtool/itemdata/item_icon/narc_0138.NCLR + files/itemtool/itemdata/item_icon/narc_0138.NCLR \ + files/poketool/trgra/trbgra/narc_0000.NCLR diff --git a/tools/nitrogfx/main.c b/tools/nitrogfx/main.c index 56cf4abd..942b0d90 100644 --- a/tools/nitrogfx/main.c +++ b/tools/nitrogfx/main.c @@ -448,6 +448,7 @@ void HandlePngToNtrPaletteCommand(char *inputPath, char *outputPath, int argc, c bool ncpr = false; bool ir = false; bool nopad = false; + int bitdepth = 0; int compNum = 0; for (int i = 3; i < argc; i++) @@ -466,7 +467,20 @@ void HandlePngToNtrPaletteCommand(char *inputPath, char *outputPath, int argc, c { nopad = true; } - if (strcmp(option, "-comp") == 0) + else if (strcmp(option, "-bitdepth") == 0) + { + if (i + 1 >= argc) + FATAL_ERROR("No bitdepth following \"-bitdepth\".\n"); + + i++; + + if (!ParseNumber(argv[i], NULL, 10, &bitdepth)) + FATAL_ERROR("Failed to parse bitdepth.\n"); + + if (bitdepth != 4 && bitdepth != 8) + FATAL_ERROR("Bitdepth must be 4 or 8.\n"); + } + else if (strcmp(option, "-comp") == 0) { if (i + 1 >= argc) FATAL_ERROR("No compression value following \"-comp\".\n"); @@ -486,7 +500,7 @@ void HandlePngToNtrPaletteCommand(char *inputPath, char *outputPath, int argc, c } ReadPngPalette(inputPath, &palette); - WriteNtrPalette(outputPath, &palette, ncpr, ir, palette.bitDepth, !nopad, compNum); + WriteNtrPalette(outputPath, &palette, ncpr, ir, bitdepth, !nopad, compNum); } void HandleGbaToJascPaletteCommand(char *inputPath, char *outputPath, int argc UNUSED, char **argv UNUSED) |