mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-17 05:15:16 +00:00
First proper commit.
This commit is contained in:
parent
be78236d36
commit
087f561f77
14086 changed files with 1200489 additions and 1 deletions
32
tools/get_overlay_stats.py
Normal file
32
tools/get_overlay_stats.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
import pprint
|
||||
|
||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
root_dir = script_dir + "/../"
|
||||
asm_dir = root_dir + "asm/non_matchings/overlays/actors"
|
||||
|
||||
overlays = {}
|
||||
|
||||
|
||||
def main():
|
||||
for root, dirs, files in os.walk(asm_dir):
|
||||
for dir in dirs:
|
||||
if dir.startswith("ovl_"):
|
||||
avg_size = 0
|
||||
max_size = -1
|
||||
ovl_path = os.path.join(root, dir)
|
||||
count = 0
|
||||
for root2, dirs2, files2 in os.walk(ovl_path):
|
||||
for file in files2:
|
||||
count += 1
|
||||
file_size = os.path.getsize(os.path.join(ovl_path, file))
|
||||
avg_size += file_size
|
||||
if file_size > max_size:
|
||||
max_size = file_size
|
||||
overlays[dir] = (max_size, count, avg_size / count)
|
||||
print({k: v for k, v in sorted(overlays.items(), key=lambda item: item[1][2])})
|
||||
|
||||
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue