You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Fixed fixlights.py compile error on python 3.12 (#798)
* Fixed fixlights.py compile error on python 3.12 * Fixed assemble_sound.py compile error on python 3.12
This commit is contained in:
@@ -66,7 +66,7 @@ def validate(cond, msg, forstr=""):
|
|||||||
|
|
||||||
|
|
||||||
def strip_comments(string):
|
def strip_comments(string):
|
||||||
string = re.sub(re.compile("/\*.*?\*/", re.DOTALL), "", string)
|
string = re.sub(re.compile(r"/\*.*?\*/", re.DOTALL), "", string)
|
||||||
return re.sub(re.compile("//.*?\n"), "", string)
|
return re.sub(re.compile("//.*?\n"), "", string)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ for file in lightFiles:
|
|||||||
curLine = fileLines[index].strip()
|
curLine = fileLines[index].strip()
|
||||||
dl_index += 1
|
dl_index += 1
|
||||||
|
|
||||||
match_result = re.search("Gfx\s*([A-Za-z_]\w+)\s*\[\s*\w*\s*\]\s*=\s*\{", curLine)
|
match_result = re.search(r"Gfx\s*([A-Za-z_]\w+)\s*\[\s*\w*\s*\]\s*=\s*\{", curLine)
|
||||||
if match_result is not None and len(match_result.groups()) >= 1:
|
if match_result is not None and len(match_result.groups()) >= 1:
|
||||||
curDL = match_result.group(1)
|
curDL = match_result.group(1)
|
||||||
dl_index = -1
|
dl_index = -1
|
||||||
@@ -136,7 +136,7 @@ def get_texscroll_files():
|
|||||||
mat_grep_commands = []
|
mat_grep_commands = []
|
||||||
for mat in material_deltas.keys():
|
for mat in material_deltas.keys():
|
||||||
print("grep -Rl \"segmented_to_virtual(" + re.escape(mat) + f"\" {sys.argv[1]}**/texscroll.inc.c")
|
print("grep -Rl \"segmented_to_virtual(" + re.escape(mat) + f"\" {sys.argv[1]}**/texscroll.inc.c")
|
||||||
mat_grep_commands.append("grep -Rl \"segmented_to_virtual(" + re.escape(mat) + f"\" {sys.argv[1]} --include \*texscroll*")
|
mat_grep_commands.append("grep -Rl \"segmented_to_virtual(" + re.escape(mat) + rf"\" {sys.argv[1]} --include \*texscroll*")
|
||||||
|
|
||||||
texscroll_files = set()
|
texscroll_files = set()
|
||||||
for cmd in mat_grep_commands:
|
for cmd in mat_grep_commands:
|
||||||
@@ -164,7 +164,7 @@ for file in t_files:
|
|||||||
curLine = curLineFull.strip()
|
curLine = curLineFull.strip()
|
||||||
|
|
||||||
if not in_func:
|
if not in_func:
|
||||||
match_result = re.search("void \w+\(\) \{", curLine)
|
match_result = re.search(r"void \w+\(\) \{", curLine)
|
||||||
in_func = match_result is not None
|
in_func = match_result is not None
|
||||||
found_mat_match = False
|
found_mat_match = False
|
||||||
continue
|
continue
|
||||||
@@ -174,7 +174,7 @@ for file in t_files:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if not found_mat_match:
|
if not found_mat_match:
|
||||||
match_result = re.search("Gfx \*mat = segmented_to_virtual\((\w*)\)", curLine)
|
match_result = re.search(r"Gfx \*mat = segmented_to_virtual\((\w*)\)", curLine)
|
||||||
if not match_result:
|
if not match_result:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ for file in t_files:
|
|||||||
mat_match = seg_mat
|
mat_match = seg_mat
|
||||||
continue
|
continue
|
||||||
|
|
||||||
match_result = re.search("shift_\w*\(mat, (\d*),", curLine)
|
match_result = re.search(r"shift_\w*\(mat, (\d*),", curLine)
|
||||||
if match_result is not None and len(match_result.groups()) >= 1:
|
if match_result is not None and len(match_result.groups()) >= 1:
|
||||||
sts_index_str = match_result.group(1)
|
sts_index_str = match_result.group(1)
|
||||||
sts_index = int(sts_index_str)
|
sts_index = int(sts_index_str)
|
||||||
|
|||||||
Reference in New Issue
Block a user