kirby64/tools/decompile_geos.py
someone2639 4095d840c1
assets.o tracking (#56)
* models migrated to new build system

* bank 0 and 1 images

* bank 0 converted

* update PR action

* dont run level settings converter anymore

* update gitignore; actually add asset makefiles (hopefully this passes CI)

* actually add tools

* bank1 tabled

* cleanup

* pass CI now

* bank2 image

* bank 2 anim

* bank2 tabled

* bank 3 tabled

* ldscript generator works; bank4 tabled

* bank5 tabled

* bank6 tabled

* all banks tabled

* asset linkscripts are fully transient now

* test empty commit

* backup

* did you know that um...

if you do file: dep

that $< will eval to dep?

* transient filetable+headers; game is playable but doesnt match

* assets OK besides objcopy

* OK

* actually commit tools wowie

* hopefully no more assets memes

* remove rogue O file that was destroying CI

* the first .png file

* more bank0 png's

* add tools to make future texture PR better

* n64graphics mod to export kirby64 backgrounds

* _actually_ add backgrounds to build system

* simplify asset image build rule

* n64graphics background heuristic in place for all formats

* bank0 backgrounds reintroduced

* revert ci8 background because I don't have n64graphics ci

* bank 0 1 and 2 new I4 textures matched

* filetable linter; banks 0-4 i4 images matched

* bank 5 too

* images all matched; next is to revert all backgrounds that report incorrect sizes

* assets makefile converted to use ld -r -b; runs much faster

* i4 textures reverted

* some ia4 textures

* some ia8 and i8 images

* use single static pattern for backgrounds

* significantly simplify o file generation in asset makefile

* add the two labeled rgba16 images

* support for relatively arbitrary paths for images/probably others

* remove two now-useless bin container tools

* upgrade n64graphics to 0.4

* new asset extractor implemented (full game doesnt build)

* start separating assets json

* rgb2c submodule; img_getprop (almost done)

* binaries in the repo fail

* it wasnt a binary it was the folder i was using...

* add the tool for real

* move folder

* game builds again; doesnt match nor boot

* OK

* assets skip palettes now; func_8000BE90

* renamed some lbvector functions

* some lbreflect matches

* more HS64 work including initial Camera struct doc

* more camera struct; renamed AObj; OMMtx initial doc

* lots of renamings

Co-authored-by: Faris Awan <farisawan.2000@gmail.com>
2022-04-07 17:41:21 -04:00

41 lines
1.4 KiB
Python

import sys, os, subprocess, glob
# if len(glob.glob("assets/geo/bank_1/**/block.bin")) == len(glob.glob("assets/geo/bank_1/**/block.c")):
# exit(0)
if "--clean" in ''.join(sys.argv):
subprocess.run("rm assets/geo/bank_0/**/block.c", shell=True)
subprocess.run("rm assets/geo/bank_1/**/block.c", shell=True)
subprocess.run("rm assets/geo/bank_2/**/block.c", shell=True)
subprocess.run("rm assets/geo/bank_3/**/block.c", shell=True)
subprocess.run("rm assets/geo/bank_4/**/block.c", shell=True)
subprocess.run("rm assets/geo/bank_6/**/block.c", shell=True)
subprocess.run("rm assets/geo/bank_7/**/block.c", shell=True)
exit(0)
# for i in sorted(glob.glob("assets/geo/bank_*/**/block.bin")):
# if "bank_1" in i\
# or "bank_0" in i\
# or "bank_2" in i\
# or "bank_3" in i\
# or "bank_7" in i:
# cfile = i.split("bin")[0] + "c"
# proc = subprocess.Popen("ls %s | wc -l" % (i.split("bin")[0]+"*"), shell=True, stdout=subprocess.PIPE)
# pc = proc.communicate()[0].decode("ascii")
# if pc != '' and int(pc) > 1:
# continue
# print(cfile)
# try:
# subprocess.run("python3 tools/scut/GeoFromBin.py %s %s" % (i, cfile), shell=True, check = True)
# except subprocess.CalledProcessError:
# break
exit(1)
cfile = sys.argv[1].split("bin")[0] + "c"
if not os.path.isfile(cfile):
try:
subprocess.run("python3 tools/scut/GeoFromBin.py %s" % sys.argv[1], shell=True, check = True)
except subprocess.CalledProcessError:
print("error in %s" % cfile)