ref: 0b05325e07648f989c612e81fb6bbd37e56813de
parent: 087e2556f2a5ab0c3d046d5b9667ae3743d48aca
author: yenatch <yenatch@github.com>
date: Sat Feb 9 00:09:58 EST 2013
Allow png->lz compression in the build process
To enable, append '${IMGFILES}' to line 22:
pokecrystal.o: pokecrystal.asm constants.asm wram.asm ${TEXTFILES} ${IMGFILES}
Also append '${LZFILES}' to line 48:
rm -f main.tx pokecrystal.o pokecrystal.gbc ${TEXTFILES} ${LZFILES}
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.SUFFIXES: .asm .tx .o .gbc
+.SUFFIXES: .asm .tx .o .gbc .png .2bpp .lz
TEXTFILES = text/sweethoney.tx \
text/phone/bill.tx \
@@ -7,8 +7,18 @@
text/phone/trainers1.tx \
main.tx
+VERTFILES = gfx/pics/%.png \
+ gfx/trainers/%.png
+
+HORIZFILES = $(filter-out gfx/%.png, $(VERTFILES))
+
+IMGFILES = ${VERTFILES} ${HORIZFILES}+
+LZFILES = gfx/%.lz
+
all: pokecrystal.gbc
+
pokecrystal.o: pokecrystal.asm constants.asm wram.asm ${TEXTFILES}rgbasm -o pokecrystal.o pokecrystal.asm
@@ -20,5 +30,20 @@
rgbfix -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -p 0 -r 3 -t PM_CRYSTAL $@
cmp baserom.gbc $@
+
+front.png: tiles.png
+ python gfx.py png-to-lz --front $@ $(OBJECT_DIRECTORY)/tiles.2bpp
+
+tiles.png:
+ python gfx.py png-to-2bpp $@
+
+.png: ${VERTFILES}+ python gfx.py png-to-lz --vert $@
+
+.png: ${HORIZFILES}+ python gfx.py png-to-lz $@
+
+
clean:
rm -f main.tx pokecrystal.o pokecrystal.gbc ${TEXTFILES}+
--
⑨