Skip to content

Commit

Permalink
fix warns
Browse files Browse the repository at this point in the history
Thanks @Ponmander for reporting this
  • Loading branch information
bates64 committed Jan 11, 2024
1 parent 6cd361e commit bfe8c5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/splat_ext/tex_archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,13 +422,13 @@ def pack_color(r, g, b, a):
palette_count = (0x20 if fmt_str == "CI4" else 0x200) // 2
if len(palette) > palette_count:
palette = palette[:palette_count]
self.warn(f"{self.img_name} has more than {palette_count} colors, truncating")
print(f"warning: {self.img_name} has more than {palette_count} colors, truncating")
elif len(palette) < palette_count:
palette += [(0, 0, 0, 0)] * (palette_count - len(palette))

for rgba in palette:
if rgba[3] not in (0, 0xFF):
self.warn("alpha mask mode but translucent pixels used")
print(f"warning: alpha mask mode but {self.img_name} has translucent pixels")

color = pack_color(*rgba)
out_pal += color.to_bytes(2, byteorder="big")
Expand Down

0 comments on commit bfe8c5b

Please sign in to comment.