Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Olympe::AnimationBank Struct Reference

Collection of animations for an entity with multi-spritesheet support. More...

#include <AnimationTypes.h>

Public Member Functions

 AnimationBank ()
 
const SpritesheetInfoGetSpritesheet (const std::string &id) const
 Get spritesheet by ID.
 
SpritesheetInfoGetSpritesheet (const std::string &id)
 
const AnimationSequenceGetSequence (const std::string &name) const
 Get animation sequence by name.
 
AnimationSequenceGetSequence (const std::string &name)
 
SDL_FRect CalculateFrameRect (int frameIndex) const
 DEPRECATED: Calculate source rectangle for a frame based on spritesheet layout.
 
const AnimationSequenceGetAnimation (const std::string &name) const
 DEPRECATED: Get animation sequence by name (use GetSequence() instead)
 

Public Attributes

std::string bankId
 Unique identifier for this animation bank.
 
std::string description
 
std::string author
 
std::string createdDate
 
std::string lastModifiedDate
 
std::vector< std::string > tags
 
std::vector< SpritesheetInfospritesheets
 
int frameWidth
 Width of each frame in pixels.
 
int frameHeight
 Height of each frame in pixels.
 
int columns
 Number of columns in spritesheet.
 
int spacing
 Spacing between frames in pixels.
 
int margin
 Margin around spritesheet edges in pixels.
 
std::unordered_map< std::string, AnimationSequenceanimations
 

Detailed Description

Collection of animations for an entity with multi-spritesheet support.

Definition at line 219 of file AnimationTypes.h.

Constructor & Destructor Documentation

◆ AnimationBank()

Olympe::AnimationBank::AnimationBank ( )
inline

Definition at line 241 of file AnimationTypes.h.

Member Function Documentation

◆ CalculateFrameRect()

SDL_FRect Olympe::AnimationBank::CalculateFrameRect ( int  frameIndex) const
inline

DEPRECATED: Calculate source rectangle for a frame based on spritesheet layout.

Parameters
frameIndexFrame index (0-based)
Returns
Source rectangle in spritesheet coordinates

Definition at line 301 of file AnimationTypes.h.

References columns, frameHeight, frameWidth, GetComponentTypeID_Static(), margin, and spacing.

+ Here is the call graph for this function:

◆ GetAnimation()

const AnimationSequence * Olympe::AnimationBank::GetAnimation ( const std::string &  name) const
inline

DEPRECATED: Get animation sequence by name (use GetSequence() instead)

Parameters
nameAnimation name
Returns
Pointer to AnimationSequence if found, nullptr otherwise
Deprecated:
Use GetSequence() for consistency with new API

Definition at line 321 of file AnimationTypes.h.

References GetSequence().

+ Here is the call graph for this function:

◆ GetSequence() [1/2]

AnimationSequence * Olympe::AnimationBank::GetSequence ( const std::string &  name)
inline

Definition at line 290 of file AnimationTypes.h.

References animations, and GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GetSequence() [2/2]

const AnimationSequence * Olympe::AnimationBank::GetSequence ( const std::string &  name) const
inline

Get animation sequence by name.

Parameters
nameAnimation name
Returns
Pointer to AnimationSequence if found, nullptr otherwise

Definition at line 284 of file AnimationTypes.h.

References animations, and GetComponentTypeID_Static().

Referenced by GetAnimation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSpritesheet() [1/2]

SpritesheetInfo * Olympe::AnimationBank::GetSpritesheet ( const std::string &  id)
inline

Definition at line 269 of file AnimationTypes.h.

References GetComponentTypeID_Static(), and spritesheets.

+ Here is the call graph for this function:

◆ GetSpritesheet() [2/2]

const SpritesheetInfo * Olympe::AnimationBank::GetSpritesheet ( const std::string &  id) const
inline

Get spritesheet by ID.

Parameters
idSpritesheet identifier
Returns
Pointer to SpritesheetInfo if found, nullptr otherwise

Definition at line 259 of file AnimationTypes.h.

References GetComponentTypeID_Static(), and spritesheets.

Referenced by Olympe::AnimationEditorWindow::RenderPreviewFrame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ animations

std::unordered_map<std::string, AnimationSequence> Olympe::AnimationBank::animations

◆ author

std::string Olympe::AnimationBank::author

◆ bankId

std::string Olympe::AnimationBank::bankId

◆ columns

int Olympe::AnimationBank::columns

Number of columns in spritesheet.

Definition at line 234 of file AnimationTypes.h.

Referenced by CalculateFrameRect().

◆ createdDate

std::string Olympe::AnimationBank::createdDate

◆ description

std::string Olympe::AnimationBank::description

◆ frameHeight

int Olympe::AnimationBank::frameHeight

Height of each frame in pixels.

Definition at line 233 of file AnimationTypes.h.

Referenced by CalculateFrameRect().

◆ frameWidth

int Olympe::AnimationBank::frameWidth

Width of each frame in pixels.

Definition at line 232 of file AnimationTypes.h.

Referenced by CalculateFrameRect().

◆ lastModifiedDate

std::string Olympe::AnimationBank::lastModifiedDate

◆ margin

int Olympe::AnimationBank::margin

Margin around spritesheet edges in pixels.

Definition at line 236 of file AnimationTypes.h.

Referenced by CalculateFrameRect().

◆ spacing

int Olympe::AnimationBank::spacing

Spacing between frames in pixels.

Definition at line 235 of file AnimationTypes.h.

Referenced by CalculateFrameRect().

◆ spritesheets

std::vector<SpritesheetInfo> Olympe::AnimationBank::spritesheets

◆ tags

std::vector<std::string> Olympe::AnimationBank::tags

Definition at line 226 of file AnimationTypes.h.

Referenced by Olympe::AnimationEditorWindow::ExportBankJSON().


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