mirror of
https://github.com/open-goal/jak-project
synced 2026-07-10 23:22:17 -04:00
d/jak2: finish glist | glist-h | camera | cam-interface | cam-states-dbg | cam-combiner | cam-debug | cam-start (#1829)
* d/jak2: finish `glist` and `glist-h` partially done `time-of-day` * d/jak2: finish `camera` and `cam-interface` * d/jak2: partially finish `cam-master` `cam-states`, and `cam-update` finish `cam-states-dbg` `cam-combiner` `cam-debug` and `cam-start` * tests: update ref tests * scripts: add scripts to automatically update gsrc files * d/jak2: update gsrc
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
# Updates files in gsrc if they are modified in the reference test folder
|
||||
# Uses git
|
||||
# TODO - get new untracked files as well
|
||||
import subprocess
|
||||
from git import Repo
|
||||
|
||||
repo = Repo("./")
|
||||
|
||||
import argparse
|
||||
import os
|
||||
|
||||
parser = argparse.ArgumentParser("update-gsrc-via-refs")
|
||||
parser.add_argument("--game", help="The name of the game", type=str)
|
||||
parser.add_argument("--decompiler", help="The path to the decompiler", type=str)
|
||||
parser.add_argument("--decompiler_config", help="The decomp config", type=str)
|
||||
args = parser.parse_args()
|
||||
|
||||
for item in repo.index.diff(None):
|
||||
path = item.b_rawpath.decode("utf-8")
|
||||
if args.game in path and "_REF" in path:
|
||||
file_name = os.path.basename(path).replace("_REF.gc", "")
|
||||
print("Decompiling - {}".format(file_name))
|
||||
# Decompile file
|
||||
subprocess.run(
|
||||
[
|
||||
args.decompiler,
|
||||
"./decompiler/config/{}".format(args.decompiler_config),
|
||||
"./iso_data",
|
||||
"./decompiler_out",
|
||||
"--config-override",
|
||||
'{{"allowed_objects": ["{}"]}}'.format(file_name),
|
||||
]
|
||||
)
|
||||
print("Updating - {}".format(file_name))
|
||||
# Update gsrc
|
||||
os.system(
|
||||
"python ./scripts/gsrc/update-from-decomp.py --game {} --file {}".format(
|
||||
args.game, file_name
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--game")
|
||||
args = parser.parse_args()
|
||||
import os
|
||||
import glob
|
||||
|
||||
def delete_extension(ext):
|
||||
fileList = glob.glob('./decompiler_out/{}/*.{}'.format(args.game, ext))
|
||||
for filePath in fileList:
|
||||
os.remove(filePath)
|
||||
|
||||
delete_extension("gc")
|
||||
delete_extension("asm")
|
||||
Reference in New Issue
Block a user