|
| template<typename PixelType > |
| std::size_t | metatile_count (const Image< PixelType > &layer) |
| | Returns how many metatiles a single layer image holds.
|
| |
| std::string | to_string (Layer layer) |
| |
| std::ostream & | operator<< (std::ostream &os, const Layer &layer) |
| |
| Layer | dropped_layer_for (LayerType layer_type) |
| | Returns the layer that dual-layerization discards for a given inferred LayerType.
|
| |
| Subtile | subtile_from_index (std::size_t i) |
| |
| std::string | to_string (Subtile layer) |
| |
| std::ostream & | operator<< (std::ostream &os, const Subtile &subtile) |
| |
| std::tuple< std::size_t, Layer, Subtile > | from_tile_index (std::size_t tile_index) |
| | Decomposes a global tile index into its metatile index, layer, and subtile position.
|
| |
| std::tuple< Layer, Subtile > | from_internal_tile_index (std::size_t tile_index) |
| | Decomposes an internal tile index into its layer and subtile position within a metatile.
|
| |
| std::string | message_header (const TextFormatter &format, std::size_t index, Layer layer, Subtile subtile, std::size_t subtile_row, std::size_t subtile_col) |
| |
| std::string | message_header (const TextFormatter &format, std::size_t index, Layer layer, Subtile subtile) |
| |
| std::string | message_header (const TextFormatter &format, std::size_t index, Subtile subtile) |
| |
Returns the layer that dual-layerization discards for a given inferred LayerType.
Dual-layer mode renders only two of a metatile's three layers, chosen by the inferred LayerType: normal renders middle/top (bottom dropped), covered renders bottom/middle (top dropped), split renders bottom/top (middle dropped). Anything written to the dropped layer is lost during conversion, so callers use this to detect and warn about such writes. Mirrors the drop behavior of LayerModeConverter::dual_layerize.
- Parameters
-
| layer_type | The inferred LayerType for the metatile |
- Returns
- The Layer that dual-layerization will drop
Definition at line 76 of file metatile.hpp.
| std::tuple< Layer, Subtile > porytiles::metatile::from_internal_tile_index |
( |
std::size_t |
tile_index | ) |
|
|
inline |
Decomposes an internal tile index into its layer and subtile position within a metatile.
Converts a tile index local to a single metatile (range 0-11) into two components:
- The layer within the metatile (bottom, middle, or top)
- The subtile position within that layer (northwest, northeast, southwest, or southeast)
Tiles within a metatile are indexed in layer-major order: bottom layer tiles (0-3), followed by middle layer tiles (4-7), then top layer tiles (8-11).
- Parameters
-
| tile_index | The internal tile index to decompose (must be in range [0, tiles_per_metatile)) |
- Precondition
- tile_index < tiles_per_metatile (i.e., tile_index must be in range [0, 11])
- Returns
- A tuple containing (layer, subtile)
- See also
- from_tile_index() for decomposing global tile indices
Definition at line 157 of file metatile.hpp.
| std::tuple< std::size_t, Layer, Subtile > porytiles::metatile::from_tile_index |
( |
std::size_t |
tile_index | ) |
|
|
inline |
Decomposes a global tile index into its metatile index, layer, and subtile position.
Converts a linear tile index from the global tileset into three components:
- The metatile index (which metatile this tile belongs to)
- The layer within that metatile (bottom, middle, or top)
- The subtile position within that layer (northwest, northeast, southwest, or southeast)
Tiles are indexed in metatile-major order: all tiles of metatile 0 come first (bottom layer, then middle layer, then top layer), followed by all tiles of metatile 1, and so on.
- Parameters
-
| tile_index | The global tile index to decompose |
- Returns
- A tuple containing (metatile_index, layer, subtile)
- See also
- from_internal_tile_index() for decomposing indices within a single metatile
Definition at line 132 of file metatile.hpp.
template<typename PixelType >
| std::size_t porytiles::metatile::metatile_count |
( |
const Image< PixelType > & |
layer | ) |
|
Returns how many metatiles a single layer image holds.
The count is derived from the layer image's pixel dimensions, the same derivation LayerImageMetatileizer::metatileize uses: (width / side_length_pix) * (height / side_length_pix). This is the number of source metatiles a Porytiles layer contributes, which is the honest row count for the attributes CSV. It intentionally does not consult the Porymap metatiles.bin, which is a different ownership surface.
- Parameters
-
| layer | A layer image (e.g. the bottom layer of a Porytiles tileset component) |
- Returns
- The number of metatiles in the layer
Definition at line 40 of file metatile.hpp.