png_to_nbpp*: add support for concatenating multiple files
This commit is contained in:
parent
d12e49aa16
commit
a443d09b3d
4
Makefile
4
Makefile
@ -54,11 +54,11 @@ gen/%.cpp: gen/%.hpp $(GEN_PYTHON_SOURCE)
|
||||
|
||||
res/%.2bpp: pokered/%.png
|
||||
@mkdir -p $(dir $@)
|
||||
python tools/png_to_nbpp.py $< 2 $@
|
||||
python tools/png_to_nbpp.py 2 $@ $<
|
||||
|
||||
res/gfx/sprites/%.2bpp: pokered/gfx/sprites/%.png
|
||||
@mkdir -p $(dir $@)
|
||||
python tools/png_to_nbpp_sprite.py $< 2 $@
|
||||
python tools/png_to_nbpp_sprite.py 2 $@ $<
|
||||
|
||||
%.2bpp.h:
|
||||
$(BUILD_BINARY_H)
|
||||
|
@ -47,13 +47,14 @@ def debug(buf, bpp):
|
||||
if (row % 8 == 7):
|
||||
print()
|
||||
|
||||
in_path = sys.argv[1]
|
||||
bpp = int(sys.argv[2])
|
||||
out_path = sys.argv[3]
|
||||
bpp = int(sys.argv[1])
|
||||
out_path = sys.argv[2]
|
||||
assert len(sys.argv) >= 4, sys.argv
|
||||
|
||||
with open(out_path, 'wb') as f:
|
||||
for in_path in sys.argv[3:]:
|
||||
im = Image.open(in_path)
|
||||
buf = convert(im, bpp)
|
||||
if 'NBPP_DEBUG' in os.environ:
|
||||
debug(buf, bpp)
|
||||
with open(out_path, 'wb') as f:
|
||||
f.write(buf)
|
||||
|
@ -56,13 +56,14 @@ def debug(buf, bpp):
|
||||
if (row % cell_height == (cell_height - 1)):
|
||||
print()
|
||||
|
||||
in_path = sys.argv[1]
|
||||
bpp = int(sys.argv[2])
|
||||
out_path = sys.argv[3]
|
||||
bpp = int(sys.argv[1])
|
||||
out_path = sys.argv[2]
|
||||
assert len(sys.argv) >= 4, sys.argv
|
||||
|
||||
with open(out_path, 'wb') as f:
|
||||
for in_path in sys.argv[3:]:
|
||||
im = Image.open(in_path)
|
||||
buf = convert(im, bpp)
|
||||
if 'NBPP_DEBUG' in os.environ:
|
||||
debug(buf, bpp)
|
||||
with open(out_path, 'wb') as f:
|
||||
f.write(buf)
|
||||
|
Loading…
x
Reference in New Issue
Block a user