|
Porytiles
|
Configuration parameters for a single tileset animation. More...
#include <anim_params.hpp>
Public Member Functions | |
| AnimParams ()=default | |
| const DynamicCasedName & | cased_name () const |
| Returns the structured name for this animation, preserving case format information. | |
| void | cased_name (DynamicCasedName value) |
| std::size_t | frame_factor () const |
| Returns the frame factor (modulus divisor for timer). | |
| void | frame_factor (std::size_t value) |
| std::size_t | frame_offset () const |
| Returns the frame offset (remainder value for timer modulo check). | |
| void | frame_offset (std::size_t value) |
| const std::vector< DynamicCasedName > & | frame_names () const |
| Returns the unique frame definitions. | |
| void | frame_names (std::vector< DynamicCasedName > value) |
| const std::vector< DynamicCasedName > & | frame_order () const |
| Returns the playback sequence. | |
| void | frame_order (std::vector< DynamicCasedName > value) |
| std::size_t | tile_offset () const |
| Returns the VRAM tile offset for this animation. | |
| void | tile_offset (std::size_t value) |
| std::size_t | tile_count () const |
| Returns the number of tiles per animation frame. | |
| void | tile_count (std::size_t value) |
| std::size_t | width_tiles () const |
| Returns the width of animation frames in tiles. | |
| void | width_tiles (std::size_t value) |
| std::size_t | height_tiles () const |
| Returns the height of animation frames in tiles. | |
| void | height_tiles (std::size_t value) |
| std::size_t | counter_max () const |
| Returns the animation counter maximum value. | |
| void | counter_max (std::size_t value) |
| const std::vector< AnimOverrideEntry > & | overrides () const |
| Returns the manual override entries for this animation. | |
| void | overrides (std::vector< AnimOverrideEntry > value) |
Configuration parameters for a single tileset animation.
AnimParams stores the configuration data needed to generate and interpret animation code for a tileset. These parameters control how animation frames are selected and where animation tiles are located in VRAM.
The parameters map directly to the generated C code patterns:
timer % frame_factor == frame_offset conditionstimer % frame_factor == frame_offset conditionsDefinition at line 36 of file anim_params.hpp.
|
default |
|
inline |
Returns the structured name for this animation, preserving case format information.
When parsing animation code (vanilla or Porytiles-managed), the animation name is extracted from C identifiers like QueueAnimTiles_General_Water_Current_LandWatersEdge. The segment after the tileset prefix (e.g., "Water_Current_LandWatersEdge") is parsed into a DynamicCasedName that preserves the two-level segment/word structure. This enables lossless conversion to any output format: to_snake_case() for map keys, to_c_identifier() for frame variable name reconstruction, to_pascal_case() for flattened identifiers.
Replaces the former vanilla_identifier_ field, which stored the original C identifier as a plain string.
Definition at line 54 of file anim_params.hpp.
|
inline |
Definition at line 59 of file anim_params.hpp.
|
inline |
Returns the animation counter maximum value.
In the generated C code, this appears as sPrimaryTilesetAnimCounterMax = counter_max in the InitTilesetAnim function. Common values are 128 and 256, controlling the timer wrap-around behavior.
Definition at line 235 of file anim_params.hpp.
|
inline |
Definition at line 240 of file anim_params.hpp.
|
inline |
Returns the frame factor (modulus divisor for timer).
In the generated C code, this appears as timer % frame_factor == frame_offset. Common values are 8 and 16, where 16 means the animation updates every 16 game frames.
Definition at line 73 of file anim_params.hpp.
|
inline |
Definition at line 78 of file anim_params.hpp.
|
inline |
Returns the unique frame definitions.
Lists all unique animation frame files. The position in this vector determines the FrameN index used in generated C code. For example, ["center", "left", "right"] means center.png is Frame0, left.png is Frame1, right.png is Frame2. Frame names can be arbitrary strings (not just numbers).
Each entry is a DynamicCasedName so that downstream code can convert losslessly to any case format (snake_case for file paths, PascalCase for C identifiers) without re-parsing.
Definition at line 115 of file anim_params.hpp.
|
inline |
Definition at line 120 of file anim_params.hpp.
|
inline |
Returns the frame offset (remainder value for timer modulo check).
In the generated C code, this appears as timer % frame_factor == frame_offset. Different animations in the same tileset use different offsets (0, 1, 2, ...) to stagger their updates and avoid visual sync artifacts.
Definition at line 92 of file anim_params.hpp.
|
inline |
Definition at line 97 of file anim_params.hpp.
|
inline |
Returns the playback sequence.
Defines the order in which animation frames are played. Each entry must reference a name from frame_names(). For example, ["center", "right", "center", "left"] means play center, then right, then center, then left. Frames can repeat in the sequence to create complex animation patterns.
Each entry is a DynamicCasedName so that downstream code can convert losslessly to any case format without re-parsing.
Definition at line 138 of file anim_params.hpp.
|
inline |
Definition at line 143 of file anim_params.hpp.
|
inline |
Returns the height of animation frames in tiles.
When non-zero, this specifies the number of 8x8 tile rows in animation frame PNGs. This value is used when writing animation frames back to disk to preserve the original grid layout. A value of 0 means dimensions were not specified and the default single-row layout is used.
Definition at line 216 of file anim_params.hpp.
|
inline |
Definition at line 221 of file anim_params.hpp.
|
inline |
Returns the manual override entries for this animation.
When using FrameLinking::manual mode, these entries explicitly map metatile positions to animation subtiles, bypassing key.png-based frame linking. Empty when using automatic mode.
Definition at line 254 of file anim_params.hpp.
|
inline |
Definition at line 259 of file anim_params.hpp.
|
inline |
Returns the number of tiles per animation frame.
In the generated C code, this appears as tile_count * TILE_SIZE_4BPP in the AppendTilesetAnimToBuffer call. This is determined by the dimensions of the animation frame PNGs.
Definition at line 176 of file anim_params.hpp.
|
inline |
Definition at line 181 of file anim_params.hpp.
|
inline |
Returns the VRAM tile offset for this animation.
In the generated C code, this appears as TILE_OFFSET_4BPP(tile_offset) in the AppendTilesetAnimToBuffer call. This value is computed by Porytiles based on where the animation's keyframe tiles are placed in tiles.png.
Definition at line 157 of file anim_params.hpp.
|
inline |
Definition at line 162 of file anim_params.hpp.
|
inline |
Returns the width of animation frames in tiles.
When non-zero, this specifies the number of 8x8 tiles per row in animation frame PNGs. This value is used when writing animation frames back to disk to preserve the original grid layout. A value of 0 means dimensions were not specified and the default single-row layout is used.
Definition at line 196 of file anim_params.hpp.
|
inline |
Definition at line 201 of file anim_params.hpp.