From 36233280d6d05d42dfd8eda135b348fde3604b38 Mon Sep 17 00:00:00 2001 From: Alex Bates <16batesa@gmail.com> Date: Tue, 22 Dec 2020 00:09:55 +0000 Subject: [PATCH] add sprite editor gui --- .gitignore | 4 ++++ .gitmodules | 5 ++++- Makefile | 29 +++++++++++++++++++++++++++-- README.md | 6 +++++- tools/star-rod | 1 + 5 files changed, 41 insertions(+), 4 deletions(-) create mode 160000 tools/star-rod diff --git a/.gitignore b/.gitignore index 61f6368094..f408c80f71 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,8 @@ settings.mk /msg /sprite +# Star Rod +/sprite/SpriteTable.xml +/mod.cfg + tools/Yay0compress diff --git a/.gitmodules b/.gitmodules index ea18e6107a..97a5208789 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "tools/n64splat"] path = tools/n64splat - url = https://github.com/ethteck/n64splat.git \ No newline at end of file + url = https://github.com/ethteck/n64splat.git +[submodule "tools/star-rod"] + path = tools/star-rod + url = https://github.com/nanaian/star-rod-for-decomp.git diff --git a/Makefile b/Makefile index 2c55403d01..5ab3810b0d 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,13 @@ ifeq ($(UNAME_S),Darwin) ICONV := tools/iconv.py UTF-8 SHIFT-JIS endif +WSL := 0 +JAVA := java +ifeq ($(findstring microsoft,$(shell cat /proc/sys/kernel/osrelease)),microsoft) + WSL := 1 + JAVA := powershell.exe -command java +endif + OLD_AS=tools/$(OS)/mips-nintendo-nu64-as CC=tools/$(OS)/cc1 @@ -115,14 +122,16 @@ tools: setup: clean submodules tools split $(LD_SCRIPT) +# tools/star-rod submodule intentionally omitted submodules: + git submodule init tools/n64splat git submodule update --init --recursive split: $(SPLAT) --modes ld bin Yay0 PaperMarioMapFS PaperMarioMessages img PaperMarioNpcSprites --new split-%: - $(SPLAT) --modes ld $* --verbose --new + $(SPLAT) --modes ld $* --verbose split-all: $(SPLAT) --modes all @@ -269,9 +278,25 @@ $(BUILD_DIR)/$(TARGET).bin: $(BUILD_DIR)/$(TARGET).elf include/ld_addrs.h: $(BUILD_DIR)/$(LD_SCRIPT) grep -E "[^\. ]+ =" $< -o | sed 's/^/extern void* /; s/ =/;/' > $@ + +### Star Rod (optional) ### + +STAR_ROD := cd tools/star-rod && $(JAVA) -jar StarRod.jar + +# lazily initialise the submodule +tools/star-rod: + git submodule init tools/star-rod + +sprite/SpriteTable.xml: tools/star-rod sources.mk + $(PYTHON) tools/star-rod/spritetable.xml.py $(NPC_SPRITES) > $@ + +editor: tools/star-rod sprite/SpriteTable.xml + $(STAR_ROD) + + ### Make Settings ### -.PHONY: clean tools test setup submodules split $(ROM) include/sprite +.PHONY: clean tools test setup submodules split editor $(ROM) include/sprite .DELETE_ON_ERROR: .SECONDARY: .PRECIOUS: $(ROM) %.Yay0 diff --git a/README.md b/README.md index 67b6c4f8ff..c0437eacfe 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,10 @@ $ make If you get `OK`, you're all set! Otherwise, please feel free to reach out to us in [our Discord channel](https://discord.gg/urUm3VG). +## Star Rod GUI + +You can open [our modified version of Star Rod](https://github.com/nanaian/star-rod-for-decomp) with `make editor`. + ## Contributing ### Dependencies @@ -136,4 +140,4 @@ make: *** [verify] Error 1 ``` > 💡 Solution -> Run `git checkout checksum.sha1` and retry building. Windows has different line endings than Linux, causing some of our tools to break. +> Run `git checkout checksum.sha1` and retry building. Windows has different line endings than Linux, causing some of our tools to break. diff --git a/tools/star-rod b/tools/star-rod new file mode 160000 index 0000000000..aec5d4c037 --- /dev/null +++ b/tools/star-rod @@ -0,0 +1 @@ +Subproject commit aec5d4c037e95227fb5f118075564031636697fe