Fix #537: Palettes generated from PNGs use .gbcpal directly.

This avoids overwriting a .pal file from a .png with the same name.
It also prevents people from trying to edit generated .pal files.
This commit is contained in:
Rangi
2018-08-31 21:39:17 -04:00
parent a71b28e5b7
commit 36b21b39d8
4 changed files with 331 additions and 326 deletions

View File

@@ -123,8 +123,6 @@ gfx/pokemon/girafarig/front.animated.tilemap: gfx/pokemon/girafarig/front.2bpp g
gfx/pokemon/%/front.dimensions: gfx/pokemon/%/front.png gfx/pokemon/%/front.dimensions: gfx/pokemon/%/front.png
tools/png_dimensions $< $@ tools/png_dimensions $< $@
gfx/pokemon/%/normal.pal: gfx/pokemon/%/normal.gbcpal
tools/palette -p $< > $@
gfx/pokemon/%/normal.gbcpal: gfx/pokemon/%/front.png gfx/pokemon/%/normal.gbcpal: gfx/pokemon/%/front.png
$(RGBGFX) -p $@ $< $(RGBGFX) -p $@ $<
gfx/pokemon/%/back.2bpp: gfx/pokemon/%/back.png gfx/pokemon/%/back.2bpp: gfx/pokemon/%/back.png
@@ -145,10 +143,6 @@ gfx/new_game/shrink1.2bpp: rgbgfx += -h
gfx/new_game/shrink2.2bpp: rgbgfx += -h gfx/new_game/shrink2.2bpp: rgbgfx += -h
gfx/trainers/%.2bpp: rgbgfx += -h gfx/trainers/%.2bpp: rgbgfx += -h
gfx/trainers/%.pal: gfx/trainers/%.gbcpal
tools/palette -p $< > $@
gfx/trainers/%.gbcpal: gfx/trainers/%.png
$(RGBGFX) -p $@ $<
gfx/mail/dragonite.1bpp: tools/gfx += --remove-whitespace gfx/mail/dragonite.1bpp: tools/gfx += --remove-whitespace
gfx/mail/large_note.1bpp: tools/gfx += --remove-whitespace gfx/mail/large_note.1bpp: tools/gfx += --remove-whitespace

File diff suppressed because it is too large Load Diff

View File

@@ -1,73 +1,76 @@
TrainerPalettes: TrainerPalettes:
; entries correspond to trainer classes ; entries correspond to trainer classes
; Each .gbcpal is generated from the corresponding .png, and
; only the middle two colors are included, not black or white.
PlayerPalette: ; Chris uses the same colors as Cal PlayerPalette: ; Chris uses the same colors as Cal
INCLUDE "gfx/trainers/cal.pal" INCBIN "gfx/trainers/cal.gbcpal", middle_colors
KrisPalette: ; Kris shares Falkner's palette KrisPalette: ; Kris shares Falkner's palette
INCLUDE "gfx/trainers/falkner.pal" INCBIN "gfx/trainers/falkner.gbcpal", middle_colors
INCLUDE "gfx/trainers/whitney.pal" INCBIN "gfx/trainers/whitney.gbcpal", middle_colors
INCLUDE "gfx/trainers/bugsy.pal" INCBIN "gfx/trainers/bugsy.gbcpal", middle_colors
INCLUDE "gfx/trainers/morty.pal" INCBIN "gfx/trainers/morty.gbcpal", middle_colors
INCLUDE "gfx/trainers/pryce.pal" INCBIN "gfx/trainers/pryce.gbcpal", middle_colors
INCLUDE "gfx/trainers/jasmine.pal" INCBIN "gfx/trainers/jasmine.gbcpal", middle_colors
INCLUDE "gfx/trainers/chuck.pal" INCBIN "gfx/trainers/chuck.gbcpal", middle_colors
INCLUDE "gfx/trainers/clair.pal" INCBIN "gfx/trainers/clair.gbcpal", middle_colors
INCLUDE "gfx/trainers/rival1.pal" INCBIN "gfx/trainers/rival1.gbcpal", middle_colors
INCLUDE "gfx/trainers/oak.pal" INCBIN "gfx/trainers/oak.gbcpal", middle_colors
INCLUDE "gfx/trainers/will.pal" INCBIN "gfx/trainers/will.gbcpal", middle_colors
INCLUDE "gfx/trainers/cal.pal" INCBIN "gfx/trainers/cal.gbcpal", middle_colors
INCLUDE "gfx/trainers/bruno.pal" INCBIN "gfx/trainers/bruno.gbcpal", middle_colors
INCLUDE "gfx/trainers/karen.pal" INCBIN "gfx/trainers/karen.gbcpal", middle_colors
INCLUDE "gfx/trainers/koga.pal" INCBIN "gfx/trainers/koga.gbcpal", middle_colors
INCLUDE "gfx/trainers/champion.pal" INCBIN "gfx/trainers/champion.gbcpal", middle_colors
INCLUDE "gfx/trainers/brock.pal" INCBIN "gfx/trainers/brock.gbcpal", middle_colors
INCLUDE "gfx/trainers/misty.pal" INCBIN "gfx/trainers/misty.gbcpal", middle_colors
INCLUDE "gfx/trainers/lt_surge.pal" INCBIN "gfx/trainers/lt_surge.gbcpal", middle_colors
INCLUDE "gfx/trainers/scientist.pal" INCBIN "gfx/trainers/scientist.gbcpal", middle_colors
INCLUDE "gfx/trainers/erika.pal" INCBIN "gfx/trainers/erika.gbcpal", middle_colors
INCLUDE "gfx/trainers/youngster.pal" INCBIN "gfx/trainers/youngster.gbcpal", middle_colors
INCLUDE "gfx/trainers/schoolboy.pal" INCBIN "gfx/trainers/schoolboy.gbcpal", middle_colors
INCLUDE "gfx/trainers/bird_keeper.pal" INCBIN "gfx/trainers/bird_keeper.gbcpal", middle_colors
INCLUDE "gfx/trainers/lass.pal" INCBIN "gfx/trainers/lass.gbcpal", middle_colors
INCLUDE "gfx/trainers/janine.pal" INCBIN "gfx/trainers/janine.gbcpal", middle_colors
INCLUDE "gfx/trainers/cooltrainer_m.pal" INCBIN "gfx/trainers/cooltrainer_m.gbcpal", middle_colors
INCLUDE "gfx/trainers/cooltrainer_f.pal" INCBIN "gfx/trainers/cooltrainer_f.gbcpal", middle_colors
INCLUDE "gfx/trainers/beauty.pal" INCBIN "gfx/trainers/beauty.gbcpal", middle_colors
INCLUDE "gfx/trainers/pokemaniac.pal" INCBIN "gfx/trainers/pokemaniac.gbcpal", middle_colors
INCLUDE "gfx/trainers/grunt_m.pal" INCBIN "gfx/trainers/grunt_m.gbcpal", middle_colors
INCLUDE "gfx/trainers/gentleman.pal" INCBIN "gfx/trainers/gentleman.gbcpal", middle_colors
INCLUDE "gfx/trainers/skier.pal" INCBIN "gfx/trainers/skier.gbcpal", middle_colors
INCLUDE "gfx/trainers/teacher.pal" INCBIN "gfx/trainers/teacher.gbcpal", middle_colors
INCLUDE "gfx/trainers/sabrina.pal" INCBIN "gfx/trainers/sabrina.gbcpal", middle_colors
INCLUDE "gfx/trainers/bug_catcher.pal" INCBIN "gfx/trainers/bug_catcher.gbcpal", middle_colors
INCLUDE "gfx/trainers/fisher.pal" INCBIN "gfx/trainers/fisher.gbcpal", middle_colors
INCLUDE "gfx/trainers/swimmer_m.pal" INCBIN "gfx/trainers/swimmer_m.gbcpal", middle_colors
INCLUDE "gfx/trainers/swimmer_f.pal" INCBIN "gfx/trainers/swimmer_f.gbcpal", middle_colors
INCLUDE "gfx/trainers/sailor.pal" INCBIN "gfx/trainers/sailor.gbcpal", middle_colors
INCLUDE "gfx/trainers/super_nerd.pal" INCBIN "gfx/trainers/super_nerd.gbcpal", middle_colors
INCLUDE "gfx/trainers/rival2.pal" INCBIN "gfx/trainers/rival2.gbcpal", middle_colors
INCLUDE "gfx/trainers/guitarist.pal" INCBIN "gfx/trainers/guitarist.gbcpal", middle_colors
INCLUDE "gfx/trainers/hiker.pal" INCBIN "gfx/trainers/hiker.gbcpal", middle_colors
INCLUDE "gfx/trainers/biker.pal" INCBIN "gfx/trainers/biker.gbcpal", middle_colors
INCLUDE "gfx/trainers/blaine.pal" INCBIN "gfx/trainers/blaine.gbcpal", middle_colors
INCLUDE "gfx/trainers/burglar.pal" INCBIN "gfx/trainers/burglar.gbcpal", middle_colors
INCLUDE "gfx/trainers/firebreather.pal" INCBIN "gfx/trainers/firebreather.gbcpal", middle_colors
INCLUDE "gfx/trainers/juggler.pal" INCBIN "gfx/trainers/juggler.gbcpal", middle_colors
INCLUDE "gfx/trainers/blackbelt_t.pal" INCBIN "gfx/trainers/blackbelt_t.gbcpal", middle_colors
INCLUDE "gfx/trainers/executive_m.pal" INCBIN "gfx/trainers/executive_m.gbcpal", middle_colors
INCLUDE "gfx/trainers/psychic_t.pal" INCBIN "gfx/trainers/psychic_t.gbcpal", middle_colors
INCLUDE "gfx/trainers/picnicker.pal" INCBIN "gfx/trainers/picnicker.gbcpal", middle_colors
INCLUDE "gfx/trainers/camper.pal" INCBIN "gfx/trainers/camper.gbcpal", middle_colors
INCLUDE "gfx/trainers/executive_f.pal" INCBIN "gfx/trainers/executive_f.gbcpal", middle_colors
INCLUDE "gfx/trainers/sage.pal" INCBIN "gfx/trainers/sage.gbcpal", middle_colors
INCLUDE "gfx/trainers/medium.pal" INCBIN "gfx/trainers/medium.gbcpal", middle_colors
INCLUDE "gfx/trainers/boarder.pal" INCBIN "gfx/trainers/boarder.gbcpal", middle_colors
INCLUDE "gfx/trainers/pokefan_m.pal" INCBIN "gfx/trainers/pokefan_m.gbcpal", middle_colors
INCLUDE "gfx/trainers/kimono_girl.pal" INCBIN "gfx/trainers/kimono_girl.gbcpal", middle_colors
INCLUDE "gfx/trainers/twins.pal" INCBIN "gfx/trainers/twins.gbcpal", middle_colors
INCLUDE "gfx/trainers/pokefan_f.pal" INCBIN "gfx/trainers/pokefan_f.gbcpal", middle_colors
INCLUDE "gfx/trainers/red.pal" INCBIN "gfx/trainers/red.gbcpal", middle_colors
INCLUDE "gfx/trainers/blue.pal" INCBIN "gfx/trainers/blue.gbcpal", middle_colors
INCLUDE "gfx/trainers/officer.pal" INCBIN "gfx/trainers/officer.gbcpal", middle_colors
INCLUDE "gfx/trainers/grunt_f.pal" INCBIN "gfx/trainers/grunt_f.gbcpal", middle_colors
INCLUDE "gfx/trainers/mysticalman.pal" INCBIN "gfx/trainers/mysticalman.gbcpal", middle_colors

View File

@@ -17,3 +17,8 @@ color EQUS "+ PAL_COLOR_SIZE *"
tiles EQUS "* LEN_2BPP_TILE" tiles EQUS "* LEN_2BPP_TILE"
tile EQUS "+ LEN_2BPP_TILE *" tile EQUS "+ LEN_2BPP_TILE *"
; extracts the middle two colors from a 2bpp binary palette
; example usage:
; INCBIN "foo.gbcpal", middle_colors
middle_colors EQUS "PAL_COLOR_SIZE, PAL_COLOR_SIZE * 2"