mirror of https://github.com/pret/pokecrystal.git
fix path handling in png make target
lz files were being decompressed to the top directory (gfx/)
This commit is contained in:
parent
bcf9eadadf
commit
b570c4d6e6
10
Makefile
10
Makefile
|
@ -44,15 +44,15 @@ pokecrystal.gbc: pokecrystal.o
|
||||||
lzs: ${VERTGFX} ${HORIZGFX}
|
lzs: ${VERTGFX} ${HORIZGFX}
|
||||||
|
|
||||||
pngs:
|
pngs:
|
||||||
cd extras; python gfx.py mass-decompress; python gfx.py dump-pngs
|
cd extras && python gfx.py mass-decompress && python gfx.py dump-pngs
|
||||||
|
|
||||||
|
|
||||||
front.png: tiles.png
|
front.png: tiles.png
|
||||||
cd extras; python gfx.py png-to-lz --front $@ $(OBJECT_DIRECTORY)/tiles.2bpp
|
cd extras && python gfx.py png-to-lz --front $@ $(OBJECT_DIRECTORY)/tiles.2bpp
|
||||||
tiles.png:
|
tiles.png:
|
||||||
cd extras; python gfx.py png-to-2bpp $@
|
cd extras && python gfx.py png-to-2bpp $@
|
||||||
.png: ${VERTGFX}
|
.png: ${VERTGFX}
|
||||||
cd extras; python gfx.py png-to-lz --vert $@
|
cd extras && python gfx.py png-to-lz --vert $@
|
||||||
.png: ${HORIZGFX}
|
.png: ${HORIZGFX}
|
||||||
cd extras; python gfx.py png-to-lz $@
|
cd extras && python gfx.py png-to-lz $@
|
||||||
|
|
||||||
|
|
|
@ -1436,8 +1436,8 @@ def mass_to_colored_png(debug=False):
|
||||||
for name in files:
|
for name in files:
|
||||||
if debug: print os.path.splitext(name), os.path.join(root, name)
|
if debug: print os.path.splitext(name), os.path.join(root, name)
|
||||||
if os.path.splitext(name)[1] == '.2bpp':
|
if os.path.splitext(name)[1] == '.2bpp':
|
||||||
if name[:5]+'.pal' in files:
|
if os.path.splitext(name)[0]+'.pal' in files:
|
||||||
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, os.path.splitext(name)[0]+'.pal'))
|
||||||
else:
|
else:
|
||||||
to_png(os.path.join(root, name))
|
to_png(os.path.join(root, name))
|
||||||
|
|
||||||
|
@ -1459,26 +1459,26 @@ def mass_to_colored_png(debug=False):
|
||||||
|
|
||||||
def mass_decompress(debug=False):
|
def mass_decompress(debug=False):
|
||||||
for root, dirs, files in os.walk('../gfx/'):
|
for root, dirs, files in os.walk('../gfx/'):
|
||||||
for file in files:
|
for name in files:
|
||||||
if 'lz' in file:
|
if 'lz' in name:
|
||||||
if '/pics' in root:
|
if '/pics' in root:
|
||||||
if 'front' in file:
|
if 'front' in name:
|
||||||
id = root.split('pics/')[1][:3]
|
id = root.split('pics/')[1][:3]
|
||||||
if id != 'egg':
|
if id != 'egg':
|
||||||
with open(root+'/'+file, 'rb') as lz: de = Decompressed(lz.read(), 'vert', sizes[int(id)-1])
|
with open(os.path.join(root, name), 'rb') as lz: de = Decompressed(lz.read(), 'vert', sizes[int(id)-1])
|
||||||
else:
|
else:
|
||||||
with open(root+'/'+file, 'rb') as lz: de = Decompressed(lz.read(), 'vert', 4)
|
with open(os.path.join(root, name), 'rb') as lz: de = Decompressed(lz.read(), 'vert', 4)
|
||||||
to_file(root+'/'+'front.2bpp', de.pic)
|
to_file(os.path.join(root, 'front.2bpp'), de.pic)
|
||||||
to_file(root+'/'+'tiles.2bpp', de.animtiles)
|
to_file(os.path.join(root, 'tiles.2bpp'), de.animtiles)
|
||||||
elif 'back' in file:
|
elif 'back' in name:
|
||||||
with open(root+'/'+file, 'rb') as lz: de = Decompressed(lz.read(), 'vert')
|
with open(os.path.join(root, name), 'rb') as lz: de = Decompressed(lz.read(), 'vert')
|
||||||
to_file(root+'/'+'back.2bpp', de.output)
|
to_file(os.path.join(root, 'back.2bpp'), de.output)
|
||||||
elif '/trainers' in root or '/fx' in root:
|
elif '/trainers' in root or '/fx' in root:
|
||||||
with open(root+'/'+file, 'rb') as lz: de = Decompressed(lz.read(), 'vert')
|
with open(os.path.join(root, name), 'rb') as lz: de = Decompressed(lz.read(), 'vert')
|
||||||
to_file(root+'/'+file[:-3]+'.2bpp', de.output)
|
to_file(os.path.join(root, os.path.splitext(name)[0]+'.2bpp'), de.output)
|
||||||
else:
|
else:
|
||||||
with open(root+'/'+file, 'rb') as lz: de = Decompressed(lz.read())
|
with open(os.path.join(root, name), 'rb') as lz: de = Decompressed(lz.read())
|
||||||
to_file(root+file[:-3]+'.2bpp', de.output)
|
to_file(os.path.join(root, os.path.splitext(name)[0]+'.2bpp'), de.output)
|
||||||
|
|
||||||
def append_terminator_to_lzs(directory):
|
def append_terminator_to_lzs(directory):
|
||||||
# fix lzs that were extracted with a missing terminator
|
# fix lzs that were extracted with a missing terminator
|
||||||
|
|
Loading…
Reference in New Issue