You've already forked SpaghettiKart
mirror of
https://github.com/izzy2lost/SpaghettiKart.git
synced 2026-03-26 16:57:37 -07:00
81a9c346d4
* Move course folders * Rename model to vertices * Rename packed to displaylists * Rename displaylists to course_displaylists.inc.c * rename vertices to course_vertices * makefile cleanup * Rename trophy_model to ceremony_data * move ceremony_data.inc.c to ending folder
21 lines
627 B
Python
21 lines
627 B
Python
import re
|
|
|
|
# Define the regex query to match the hex values
|
|
regex_query = r'0x07[0-9a-fA-F]{6}'
|
|
|
|
# Define a function to process each match
|
|
def process_match(match):
|
|
offset = int(match.group(0)[4:], 16)
|
|
return f"d_course_big_donut_packed_dl_{hex(offset)[2:].upper()}"
|
|
|
|
# Open the input file
|
|
with open("courses/big_donut/packed.inc.c", "r") as f:
|
|
# Read the file contents
|
|
file_content = f.read()
|
|
|
|
# Use re.sub() to find and replace all matches in the file content
|
|
modified_content = re.sub(regex_query, process_match, file_content)
|
|
|
|
# Print the modified content to console
|
|
print(modified_content)
|