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:
parent
6f2fe268e3
commit
a6162dc8e7
2 changed files with 1083 additions and 1 deletions
|
@ -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
Loading…
Add table
Reference in a new issue