papermario/tools/compare_shapes.py
Ethan Roseman 4ad11af535
mapfs shape data (#1087)
* script

* fix prologue printing

* added type hints for return types

* model docs

* more models

* pretty print for sprite xmls on earlier python ver

* 1x oops

* sprite xml labels

* cod cleanup

* type cleanup

* fixes, script erroring

* script fixes

* objcopy

* link, objcopy, etc

* map_shape.ld

* discard

* kpa_117 match

* move stuff into /geom

* fix some shapes

* 253

* 221

* opaque lights

* 488

* all clear

* fixies

* RDP_MATRIX macro

* more explicit property 5F

---------

Co-authored-by: HailSanta <Hail2Santa@gmail.com>
2023-07-18 18:07:58 +09:00

29 lines
757 B
Python
Executable File

#!/usr/bin/env python3
import filecmp
import os
from pathlib import Path
total = 0
matching = 0
for root, dirs, files in os.walk("assets/us/mapfs/geom"):
for file in files:
if file.endswith("_shape.bin"):
total += 1
shape_file = os.path.join(root, file)
built_data_file = Path("ver/us/build") / shape_file.replace(
"_shape.bin", "_shape_data.bin"
)
if filecmp.cmp(shape_file, built_data_file, shallow=False):
matching += 1
else:
if total - matching == 10:
print("...")
if total - matching < 10:
print(file, "X")
print()
print(f"{matching} of {total} files match")