From ad0578fda0aec42c28e3db26bbf68d06aa19f63e Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 12 Feb 2013 03:17:05 -0500 Subject: Fix png export orientation A quirk of the Decompressed class dissociated the orientation from the output attribute. The makefile no longer suppresses output since it's still relevant. --- extras/gfx.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'extras/gfx.py') diff --git a/extras/gfx.py b/extras/gfx.py index c641ab7f1..d2e2abfb6 100644 --- a/extras/gfx.py +++ b/extras/gfx.py @@ -610,6 +610,8 @@ class Decompressed: self.tiles = transpose(self.tiles) self.pic = connect(self.tiles) + self.output = self.pic + self.animtiles + def decompress(self): """replica of crystal's decompression""" -- cgit v1.2.3 From 7f7f4612404b6c898d4cb50fb4468580dbd46910 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 12 Feb 2013 03:40:41 -0500 Subject: Export any detected palettes to png by default Checks for any palette using the same name as the 2bpp file. --- extras/gfx.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'extras/gfx.py') diff --git a/extras/gfx.py b/extras/gfx.py index d2e2abfb6..3aa98b3ca 100644 --- a/extras/gfx.py +++ b/extras/gfx.py @@ -1430,13 +1430,16 @@ def mass_to_png(debug=False): to_png(os.path.join(root, name)) def mass_to_colored_png(debug=False): - # greyscale + # greyscale, unless a palette is detected for root, dirs, files in os.walk('../gfx/'): if 'pics' not in root and 'trainers' not in root: for name in files: if debug: print os.path.splitext(name), os.path.join(root, name) if os.path.splitext(name)[1] == '.2bpp': - to_png(os.path.join(root, name)) + if name[:5]+'.pal' in files: + to_png(os.path.join(root, name), None, os.path.join(root, name[:-5]+'.pal')) + else: + to_png(os.path.join(root, name)) # only monster and trainer pics for now for root, dirs, files in os.walk('../gfx/pics/'): @@ -1451,7 +1454,7 @@ def mass_to_colored_png(debug=False): for name in files: if debug: print os.path.splitext(name), os.path.join(root, name) if os.path.splitext(name)[1] == '.2bpp': - to_png(os.path.join(root, name), None, os.path.join(root, name[:-5] + '.pal')) + to_png(os.path.join(root, name), None, os.path.join(root, name[:-5]+'.pal')) def mass_decompress(debug=False): -- cgit v1.2.3