mirror of
https://github.com/open-goal/jak-project
synced 2026-07-06 05:54:45 -04:00
73a4f2c83e
* scripts: Hack script to quickly identify the next goal_src file that hasn't been decomp'd yet * config: Delete old type_hints file * decomp: Decompile lights.gc * decomp-tests: Add offline tests and temporary forward defs * vs: Rename / add new offline test run config * decomp: Add formatted lights.gc source * decomp: Temporary define stub in geometry,gc * decomp: Cleanup `lights-group` handling
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
import sys
|
|
from jak1_file_list import file_list
|
|
|
|
skip_count = 0
|
|
if len(sys.argv) >= 2:
|
|
skip_count = int(sys.argv[1])
|
|
|
|
print(skip_count)
|
|
|
|
new_file_contents = []
|
|
|
|
for file in file_list:
|
|
with open("goal_src/" + file[4] + "/" + file[0] + ".gc") as f:
|
|
lines = f.readlines()
|
|
# print("goal_src/" + file[4] + "/" + file[0] + ".gc" + " " + str(len(lines)))
|
|
if skip_count <= 0 and len(lines) <= 7:
|
|
print("Next file to decompile is - " + file[0])
|
|
print("Target is - " + "goal_src/" + file[4] + "/" + file[0] + ".gc")
|
|
print("Uses the following CGO / DGO - " + str(file[3]))
|
|
# TODO, update the CGO/DGO
|
|
with open("decompiler\config\jak1_ntsc_black_label.jsonc", "r") as config_file:
|
|
cfg_lines = config_file.readlines()
|
|
for line in cfg_lines:
|
|
if "allowed_objects" in line:
|
|
line = " \"allowed_objects\": [\"" + file[0] + "\"],\n"
|
|
new_file_contents.append(line)
|
|
if len(new_file_contents) > 0:
|
|
with open("decompiler\config\jak1_ntsc_black_label.jsonc", "w") as f:
|
|
f.writelines(new_file_contents)
|
|
print("Allowed objects list updated")
|
|
break
|
|
elif len(lines) <= 7:
|
|
skip_count = skip_count - 1
|
|
|
|
|