Porytiles
Loading...
Searching...
No Matches
porytiles::PalettePacking Struct Reference

Result from the high-level tile packing operation. More...

#include <palette_packer.hpp>

Collaboration diagram for porytiles::PalettePacking:
[legend]

Public Member Functions

 PalettePacking ()=default
 

Public Attributes

std::array< std::optional< Palette< Rgba32, pal::max_size > >, pal::num_palspals_
 The final hardware palettes with colors assigned.
 
std::map< std::size_t, std::size_t > tile_to_pal_
 Maps regular tile ids to their assigned hardware palette indices.
 

Detailed Description

Result from the high-level tile packing operation.

PalettePacking contains the final hardware palettes and the mapping from tile IDs to their assigned palette indices after a successful packing operation.

Definition at line 125 of file palette_packer.hpp.

Constructor & Destructor Documentation

◆ PalettePacking()

porytiles::PalettePacking::PalettePacking ( )
default

Member Data Documentation

◆ pals_

std::array<std::optional<Palette<Rgba32, pal::max_size> >, pal::num_pals> porytiles::PalettePacking::pals_

The final hardware palettes with colors assigned.

Each palette is indexed by its hardware palette index (0, 1, 2, ...). A std::nullopt entry signifies that the palette packer performed no assignments for that palette index; the corresponding palette in the Porymap component will be left untouched. For populated palettes, slot 0 contains the transparency color (preserved from input or defaulted), remaining slots contain packed colors, and unfilled slots contain Rgba32{0, 0, 0}.

Definition at line 137 of file palette_packer.hpp.

◆ tile_to_pal_

std::map<std::size_t, std::size_t> porytiles::PalettePacking::tile_to_pal_

Maps regular tile ids to their assigned hardware palette indices.

The key is the tile id (index). The value is the hardware palette index to which the tile was assigned.

Definition at line 145 of file palette_packer.hpp.


The documentation for this struct was generated from the following file: