mirror of
https://github.com/HackerN64/HackerOoT.git
synced 2026-01-21 10:37:37 -08:00
Merge remote-tracking branch 'decomp/main' into decomp_merge
This commit is contained in:
12
format.py
12
format.py
@@ -157,12 +157,22 @@ def format_files(src_files: List[str], extra_files: List[str], nb_jobs: int):
|
||||
|
||||
|
||||
def list_files_to_format():
|
||||
files = glob.glob("src/**/*.c", recursive=True)
|
||||
files = (
|
||||
glob.glob("src/**/*.c", recursive=True)
|
||||
+ glob.glob("assets/**/*.c", recursive=True)
|
||||
)
|
||||
extra_files = (
|
||||
glob.glob("assets/**/*.xml", recursive=True)
|
||||
+ glob.glob("include/**/*.h", recursive=True)
|
||||
+ glob.glob("src/**/*.h", recursive=True)
|
||||
+ glob.glob("assets/**/*.h", recursive=True)
|
||||
)
|
||||
|
||||
# Do not format assets/text/ files
|
||||
for assets_text_f in glob.glob("assets/text/**/*.c", recursive=True):
|
||||
if assets_text_f in files:
|
||||
files.remove(assets_text_f)
|
||||
|
||||
return files, extra_files
|
||||
|
||||
|
||||
|
||||
@@ -51,6 +51,8 @@ class ExtractionContext:
|
||||
baserom_path: Path
|
||||
build_path: Path
|
||||
extracted_path: Path
|
||||
write_source: set[str]
|
||||
"""Paths of source .c files to write"""
|
||||
|
||||
def get_baserom_file_data(self, baserom_file_name: str):
|
||||
return memoryview((self.baserom_path / baserom_file_name).read_bytes())
|
||||
@@ -289,7 +291,10 @@ def process_pool(
|
||||
file.write_resources_extracted(file_memctx)
|
||||
|
||||
# "source" refers to the main .c and .h `#include`ing all the extracted resources
|
||||
if WRITE_SOURCE:
|
||||
if WRITE_SOURCE and (
|
||||
str(file.source_c_path.relative_to(extraction_ctx.extracted_path))
|
||||
in extraction_ctx.write_source
|
||||
):
|
||||
file.write_source()
|
||||
|
||||
|
||||
@@ -404,6 +409,7 @@ def main():
|
||||
args.baserom_segments_dir,
|
||||
Path("build") / args.oot_version,
|
||||
args.output_dir,
|
||||
set((Path(__file__).parent / "write_source.txt").read_text().splitlines()),
|
||||
)
|
||||
|
||||
z64_resource_handlers.register_resource_handlers()
|
||||
|
||||
1076
tools/assets/extract/write_source.txt
Normal file
1076
tools/assets/extract/write_source.txt
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user