|
Porytiles
|
A complete tileset animation with name, configuration, and frame data. More...
#include <animation.hpp>
Public Member Functions | |
| Animation ()=default | |
| Animation (std::string name) | |
| Animation (std::string name, AnimParams params) | |
| const std::string & | name () const |
| const AnimParams & | params () const |
| void | params (AnimParams params) |
| bool | has_key_frame () const |
| Checks if this animation has a key frame set. | |
| const AnimFrame< PixelType > & | key_frame () const |
| Returns the key frame of this animation. | |
| void | key_frame (AnimFrame< PixelType > key_frame) |
| const std::map< std::string, AnimFrame< PixelType > > & | frames () const |
| std::map< std::string, AnimFrame< PixelType > > & | frames () |
| std::vector< AnimFrame< PixelType > > | frames_values () const |
| bool | has_frames () const |
| Checks if this animation has any frames. | |
| std::size_t | frame_count () const |
| Returns the number of frames in this animation. | |
| bool | has_frame (const std::string &frame_name) |
| const AnimFrame< PixelType > & | frame_for_name (const std::string &frame_name) const |
| Returns the frame with the specified name. | |
| void | put_frame (const std::string &name, AnimFrame< PixelType > frame) |
| Adds a frame to this Animation frame map. | |
| AnimFrame< PixelType > | composite_frame (const PixelType &extrinsic_transparency) const |
| Returns the "composite" frame for this animation. | |
A complete tileset animation with name, configuration, and frame data.
Animation represents a full animation definition for a tileset, combining:
In addition to the standard frames, there is a special "key frame" that appears in tiles.png. The GBA game engine uses the other frames (stored as separate .4bpp files) to animate by swapping tile data in VRAM at runtime.
The template parameter determines the pixel format:
| PixelType | The pixel type for animation frame tiles; must satisfy SupportsTransparency concept |
Definition at line 78 of file animation.hpp.
|
default |
|
inlineexplicit |
Definition at line 82 of file animation.hpp.
|
inline |
Definition at line 84 of file animation.hpp.
|
inline |
Returns the "composite" frame for this animation.
The "composite" frame for an Animation is a special, artificially constructed frame where each constituent subtile contains all colors across all AnimFrames (including the key frame, if present) for the given subtile index. This is essential: since animation tiles are dynamic but the palette index is fixed, the palette packer needs to know all possible colors that could appear in a given 8x8 animation tile region at any point in the animation. The composite frame's pixel arrangement is arbitrary and shouldn't be relied upon for meaningful information.
If a key frame is present, its tile count determines the composite frame size. Otherwise, the first regular frame's tile count is used. This allows animations without key frames to support manual animation linking workflows.
| extrinsic_transparency | The extrinsic transparency color to use when filtering pixels |
Definition at line 220 of file animation.hpp.
|
inline |
Returns the number of frames in this animation.
Definition at line 164 of file animation.hpp.
|
inline |
Returns the frame with the specified name.
| frame_name | The frame name |
Definition at line 181 of file animation.hpp.
|
inline |
Definition at line 139 of file animation.hpp.
|
inline |
Definition at line 134 of file animation.hpp.
|
inline |
Definition at line 144 of file animation.hpp.
|
inline |
Definition at line 169 of file animation.hpp.
|
inline |
Checks if this animation has any frames.
Definition at line 154 of file animation.hpp.
|
inline |
Checks if this animation has a key frame set.
Definition at line 106 of file animation.hpp.
|
inline |
Returns the key frame of this animation.
The key frame is a special frame of the animation and is the frame whose tiles are stored in tiles.png. All other frames are stored as separate .4bpp files and loaded dynamically by the game engine.
Definition at line 121 of file animation.hpp.
|
inline |
Definition at line 129 of file animation.hpp.
|
inline |
Definition at line 86 of file animation.hpp.
|
inline |
Definition at line 91 of file animation.hpp.
|
inline |
Definition at line 96 of file animation.hpp.
|
inline |
Adds a frame to this Animation frame map.
| name | The frame name |
| frame | The frame to add |
Definition at line 195 of file animation.hpp.