Skip to content
7 changes: 2 additions & 5 deletions omftools/pyshadowdive/bk.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ def read(self, parser: BinaryParser) -> BKFile:

# Read up all available color palettes
palette_count = parser.get_uint8()
self.palettes = []
for _ in range(palette_count):
palette_mapping = PaletteMapping().read(parser)
self.palettes.append(palette_mapping)
self.palettes = [PaletteMapping().read(parser) for _ in range(palette_count)]

# Get sound mappings
self.sound_table = [parser.get_uint8() for _ in range(30)]
Expand Down Expand Up @@ -193,7 +190,7 @@ def get_processed_palette(self, filename: str) -> Palette:
"MELEE",
]
):
palette.mask_range(0, 97) # Blank out 0-96, the HAR colors
palette.reset_range(0, 96) # Blank out 0-96, the HAR colors
palette.reset_range(250, 6) # Reset indices 250-255
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments about reset_range() seem to be conflicting. Does reset_range(0, 96) include the last index? Since palette.reset_range(250, 6) seems to indicate the last index is not included.


# NORTH_AM, WAR, KATUSHAI: Extended color slides
Expand Down
2 changes: 1 addition & 1 deletion omftools/pyshadowdive/palette.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class Palette(DataObject):
schema = Dict({"data": List(Tuple(UInt8, UInt8, UInt8))})

def __init__(self) -> None:
self.data: list[Color] = list(DEFAULT_PALETTE)
self.data: list[Color] = DEFAULT_PALETTE

def remap(self, remapping: Remapping) -> Palette:
pal = Palette()
Expand Down