1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-06-07 17:11:50 +00:00

Add write_source.txt: list of files to write source for during assets extraction (#2531)

This commit is contained in:
Dragorn421 2025-05-21 02:19:25 +02:00 committed by GitHub
parent 6f2fe268e3
commit a6162dc8e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1083 additions and 1 deletions

View file

@ -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()

File diff suppressed because it is too large Load diff