mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Decompiled 4 functions from unknown_0ABDF0
This commit is contained in:
@@ -26,6 +26,8 @@ class GenerateAssets:
|
||||
self.generate_ucode_files()
|
||||
|
||||
def generate_assets_file(self):
|
||||
with open(self.ASSETS_DIR + "/" + self.VERSION + '/ignoreMe.txt', 'w') as a_file:
|
||||
a_file.write("This file is automatically generated by generate_assets.py, and is used to check if the assets have been updated.")
|
||||
args = ["tools/dkr_assets_tool", "-i", self.VERSION, self.ASSETS_DIR, INCLUDE_DIRECTORY, self.BUILD_DIR, self.ASSETS_ASM_DIR]
|
||||
createAssets = subprocess.Popen(args, stdout=subprocess.PIPE)
|
||||
createAssets.wait()
|
||||
|
||||
@@ -228,19 +228,9 @@ class GenerateLD:
|
||||
files.sort(key = lambda x: (x[2], x[3])) # Sort tuples by RAM address and prioritize src files first.
|
||||
return files
|
||||
|
||||
checksum_file = './assets/' + VERSION + '/md5.txt'
|
||||
if not os.path.exists('./dkr.ld') and os.path.exists(checksum_file):
|
||||
os.remove(checksum_file)
|
||||
|
||||
if os.path.exists(checksum_file):
|
||||
with open(checksum_file, "rt") as a_file:
|
||||
with open('./assets/' + VERSION + '/assets.json',"rb") as f:
|
||||
bytes = f.read() # read file as bytes
|
||||
readable_hash = hashlib.md5(bytes).hexdigest();
|
||||
compare_hash = a_file.read().rstrip()
|
||||
if compare_hash != readable_hash:
|
||||
with open(LD_NAME, 'w') as ldFile:
|
||||
GenerateLD(ldFile)
|
||||
else:
|
||||
# A nice side-effect of the ./assets/<version>/ directory being "read-only" is that we can write a file to it,
|
||||
# and then if it gets deleted we'll know if the assets have been updated.
|
||||
if not os.path.exists('./dkr.ld') or not os.path.exists('./assets/' + VERSION + '/ignoreMe.txt'):
|
||||
with open(LD_NAME, 'w') as ldFile:
|
||||
GenerateLD(ldFile)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user