d/jak2: finish drawable-group | drawable-inline-array | drawable-tree and path (#1899)

This commit is contained in:
Tyler Wilding
2022-09-24 12:27:02 -04:00
committed by GitHub
parent 66b19296ef
commit e64414d9d0
33 changed files with 1852 additions and 401 deletions
+16 -2
View File
@@ -93,6 +93,7 @@ lines_to_ignore = [
";; failed to figure",
";; Used lq/sq",
";; this part is debug only",
";; WARN: Return type mismatch int vs none"
]
if decomp_ignore_errors:
@@ -180,6 +181,19 @@ else:
if args.preserve:
handle_dangling_blocks(comments, final_lines, debug_lines)
# Step 4: Write it out
# Step 4.a: Remove excessive new-lines from the end of the output, only leave a single empty new-line
lines_to_ignore = 0
i = len(final_lines) - 1
while i > 0 and (final_lines[i] == "\n" or final_lines[i] == "0\n"):
print(final_lines[i])
lines_to_ignore = lines_to_ignore + 1
i = i - 1
print("ignoring - {}".format(lines_to_ignore))
# Step 4.b: Write it out
with open(gsrc_path, "w") as f:
f.writelines(final_lines)
i = 0
while i + lines_to_ignore < len(final_lines):
f.write(final_lines[i])
i = i + 1