mirror of
https://github.com/pmret/papermario.git
synced 2024-11-18 17:02:46 +01:00
29c3ffa2e0
* clean * git subrepo pull --force tools/splat subrepo: subdir: "tools/splat" merged: "901241040d" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "901241040d" git-subrepo: version: "0.4.5" origin: "https://github.com/ingydotnet/git-subrepo" commit: "aa416e4" * splat update * more matches after nop hack * git subrepo pull --force tools/splat subrepo: subdir: "tools/splat" merged: "715ee0ad55" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "715ee0ad55" git-subrepo: version: "0.4.5" origin: "https://github.com/ingydotnet/git-subrepo" commit: "aa416e4" * Renames, match boot_idle * one mo * wips * fish func Co-authored-by: @JaThePlayer * sushie dun * warnings * clean * match a nok func * nok_02 stuff * nok_04 party image * func_802BD5D8_3174F8 * LoadPartyImage & stuff * warnings
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
from typing import Dict
|
|
|
|
from segtypes.common.group import CommonSegGroup
|
|
from segtypes.n64.ci import N64SegCi
|
|
from segtypes.n64.palette import N64SegPalette as Palette
|
|
|
|
# Resolve Raster#palette and Palette#raster links
|
|
def initialize(all_segments):
|
|
def process(segments):
|
|
raster_map: Dict[str, N64SegCi] = {}
|
|
palette_map: Dict[str, Palette] = {}
|
|
|
|
for segment in segments:
|
|
if isinstance(segment, Palette):
|
|
palette_map[segment.name] = segment
|
|
|
|
if isinstance(segment, N64SegCi):
|
|
raster_map[segment.name] = segment
|
|
|
|
if isinstance(segment, CommonSegGroup):
|
|
process(segment.subsegments)
|
|
|
|
for raster_name in raster_map:
|
|
raster = raster_map[raster_name]
|
|
# print(f"{raster_name} -> {raster.palette_name}")
|
|
raster.palette = palette_map.get(raster.palette_name)
|
|
|
|
for palette_name in palette_map:
|
|
palette = palette_map[palette_name]
|
|
# print(f"{palette_name} -> {palette.raster_name}")
|
|
palette.raster = raster_map.get(palette.raster_name)
|
|
|
|
process(all_segments)
|