From 0b05325e07648f989c612e81fb6bbd37e56813de Mon Sep 17 00:00:00 2001 From: yenatch Date: Sat, 9 Feb 2013 05:09:58 -0500 Subject: [PATCH] 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} --- Makefile | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 44d24932f..fbd7bc5c0 100644 --- 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 @@ TEXTFILES = text/sweethoney.tx \ 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 @@ pokecrystal.gbc: pokecrystal.o 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} +