Skip to content

Commit

Permalink
fix pm_sprites caching
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Bates <[email protected]>
  • Loading branch information
whosblumiere and bates64 committed Feb 18, 2024
1 parent e1176ac commit ec50283
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tools/splat_ext/pm_sprites.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,11 +719,15 @@ class N64SegPm_sprites(N64Segment):
def __init__(self, rom_start, rom_end, type, name, vram_start, args, yaml) -> None:
super().__init__(rom_start, rom_end, type, name, vram_start, args=args, yaml=yaml)

with (Path(__file__).parent / f"npc_sprite_names.yaml").open("r") as f:
path = Path(__file__).parent / f"npc_sprite_names.yaml"
with path.open("r") as f:
self.npc_cfg = yaml_loader.load(f.read(), Loader=yaml_loader.SafeLoader)
self.npc_cfg_modified_time = path.stat().st_mtime

with (Path(__file__).parent / f"player_sprite_names.yaml").open("r") as f:
path = Path(__file__).parent / f"player_sprite_names.yaml"
with path.open("r") as f:
self.player_cfg = yaml_loader.load(f.read(), Loader=yaml_loader.SafeLoader)
self.player_cfg_modified_time = path.stat().st_mtime

def out_path(self):
return options.opts.asset_path / "sprite" / "sprites"
Expand Down Expand Up @@ -852,4 +856,4 @@ def get_linker_entries(self):
return [LinkerEntry(self, src_paths, self.out_path(), self.get_linker_section(), self.get_linker_section())]

def cache(self):
return (self.yaml, self.rom_end, self.player_cfg, self.npc_cfg)
return (self.yaml, self.rom_end, self.player_cfg_modified_time, self.npc_cfg_modified_time)

0 comments on commit ec50283

Please sign in to comment.