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

Input data aggregate for the low-level palette packing algorithm. More...

#include <packing_strategy.hpp>

Collaboration diagram for porytiles::PackingInput:
[legend]

Public Attributes

std::vector< PackableTiletiles_ {}
 Regular tiles to pack into palettes.
 
std::vector< PackableTilehints_ {}
 Priority "hint" tiles that can be assigned before regular tiles.
 
std::set< PrefilledPaletteprefilled_pals_ {}
 Pre-assigned palettes with fixed colors.
 
PalettePool pal_pool_
 A bitset marking which palettes are available for editing.
 
std::size_t pal_capacity_ = pal::max_size - 1
 Maximum number of colors per palette.
 
std::optional< ShapeGroupMetadatashape_group_metadata_ {}
 Optional shape group metadata for sharing-aware packing.
 

Detailed Description

Input data aggregate for the low-level palette packing algorithm.

Definition at line 21 of file packing_strategy.hpp.

Member Data Documentation

◆ hints_

std::vector<PackableTile> porytiles::PackingInput::hints_ {}

Priority "hint" tiles that can be assigned before regular tiles.

Hints can optionally be processed first by the packing algorithm. This allows users to ensure certain colors group together during packing.

Definition at line 34 of file packing_strategy.hpp.

◆ pal_capacity_

std::size_t porytiles::PackingInput::pal_capacity_ = pal::max_size - 1

Maximum number of colors per palette.

GBA hardware palettes have 16 slots, but slot 0 is transparency, leaving 15 usable color slots. Default is 15.

Definition at line 65 of file packing_strategy.hpp.

◆ pal_pool_

PalettePool porytiles::PackingInput::pal_pool_

A bitset marking which palettes are available for editing.

For primary tilesets, typically the first six bits (bits 0 through 5) should be set. For secondary tilesets, this is typically bits 0 through 12, with the first six palettes fully locked as PrefilledPalettes.

In some configurations, out-of-band palettes may be enabled for packing. This corresponds to the "Primary Palette Fixing" case (see topic_staging_area.md), a technique used in the community to expand available primary tileset colors without modifying fieldmap parameters.

Definition at line 57 of file packing_strategy.hpp.

◆ prefilled_pals_

std::set<PrefilledPalette> porytiles::PackingInput::prefilled_pals_ {}

Pre-assigned palettes with fixed colors.

These palettes represent hardware palettes that already have some colors assigned. The packer must work around these constraints when assigning tiles.

Definition at line 43 of file packing_strategy.hpp.

◆ shape_group_metadata_

std::optional<ShapeGroupMetadata> porytiles::PackingInput::shape_group_metadata_ {}

Optional shape group metadata for sharing-aware packing.

When present, strategies should prefer placing shape group siblings in different palettes to maximize tile sharing opportunities. Each strategy applies sharing awareness differently:

  • BestFusion/O&R: adds a cost penalty when a candidate palette contains a sibling.
  • Backtracking: sorts sibling-containing palettes lower in the candidate list.

When std::nullopt, strategy behavior is identical to non-sharing-aware packing.

Definition at line 78 of file packing_strategy.hpp.

◆ tiles_

std::vector<PackableTile> porytiles::PackingInput::tiles_ {}

Regular tiles to pack into palettes.

Definition at line 25 of file packing_strategy.hpp.


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