FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
Action visual contains data that is needed to visualize different actions on screen. More...
#include <visual.h>
Public Member Functions | |
virtual | ~ActionVisual () |
Destructor. More... | |
void | addAnimation (uint32_t angle, AnimationPtr animationptr) |
Adds new animation with given angle (degrees) More... | |
AnimationPtr | getAnimationByAngle (int32_t angle) |
Gets index to animation closest to given angle. More... | |
void | addAnimationOverlay (uint32_t angle, int32_t order, AnimationPtr animationptr) |
Adds new animation overlay with given angle (degrees) and order. More... | |
std::map< int32_t, AnimationPtr > | getAnimationOverlay (int32_t angle) |
Gets map with animations closest to given angle. More... | |
void | removeAnimationOverlay (uint32_t angle, int32_t order) |
Removes animation overlay with given angle (degrees) and order. More... | |
void | addColorOverlay (uint32_t angle, const OverlayColors &colors) |
Adds new color overlay with given angle (degrees) and colors. More... | |
OverlayColors * | getColorOverlay (int32_t angle) |
Gets OverlayColors for given angle (degrees). More... | |
void | removeColorOverlay (int32_t angle) |
Removes color overlay with given angle (degrees). More... | |
void | addColorOverlay (uint32_t angle, int32_t order, const OverlayColors &colors) |
Adds new color overlay with given angle (degrees), order and colors. More... | |
OverlayColors * | getColorOverlay (int32_t angle, int32_t order) |
Gets OverlayColors for given angle (degrees) and order. More... | |
void | removeColorOverlay (int32_t angle, int32_t order) |
Removes color overlay with given angle (degrees) and order. More... | |
void | getActionImageAngles (std::vector< int32_t > &angles) |
Returns list of available angles for this Action. More... | |
void | convertToOverlays (bool color) |
Convertes animations and optional color overlay to default animation overlay. More... | |
bool | isAnimationOverlay () |
Returns true if it exists a animation overlay, otherwise false. More... | |
bool | isColorOverlay () |
Returns true if it exists a color overlay, otherwise false. More... | |
![]() | |
virtual | ~Visual2DGfx () |
Destructor. More... | |
![]() | |
virtual | ~IVisual () |
Static Public Member Functions | |
static ActionVisual * | create (Action *action) |
Constructs and assigns it to the passed item. More... | |
Private Types | |
typedef std::map< uint32_t, AnimationPtr > | AngleAnimationMap |
typedef std::map< uint32_t, std::map< int32_t, AnimationPtr > > | AngleAnimationOverlayMap |
typedef std::map< uint32_t, OverlayColors > | AngleColorOverlayMap |
typedef std::map< uint32_t, std::map< int32_t, OverlayColors > > | AngleColorAnimationOverlayMap |
Private Member Functions | |
ActionVisual () | |
Constructor. More... | |
Additional Inherited Members | |
![]() | |
Visual2DGfx () | |
Constructor. More... | |
Action visual contains data that is needed to visualize different actions on screen.
|
private |
|
private |
|
private |
|
private |
|
virtual |
Destructor.
Definition at line 237 of file visual.cpp.
|
private |
Constructor.
Definition at line 225 of file visual.cpp.
Referenced by create().
void FIFE::ActionVisual::addAnimation | ( | uint32_t | angle, |
AnimationPtr | animationptr | ||
) |
Adds new animation with given angle (degrees)
Definition at line 240 of file visual.cpp.
References m_animation_map, and m_map.
Referenced by FIFE::ObjectLoader::load().
void FIFE::ActionVisual::addAnimationOverlay | ( | uint32_t | angle, |
int32_t | order, | ||
AnimationPtr | animationptr | ||
) |
Adds new animation overlay with given angle (degrees) and order.
Definition at line 250 of file visual.cpp.
References m_animationOverlayMap, and m_map.
Referenced by FIFE::Instance::addAnimationOverlay(), and convertToOverlays().
void FIFE::ActionVisual::addColorOverlay | ( | uint32_t | angle, |
const OverlayColors & | colors | ||
) |
Adds new color overlay with given angle (degrees) and colors.
Note: Works only for single animations not for AnimationOverlays. (order is missing)
Definition at line 275 of file visual.cpp.
References FIFE::OverlayColors::changeColor(), FIFE::OverlayColors::getColorOverlayAnimation(), FIFE::OverlayColors::getColors(), m_colorOverlayMap, m_map, and FIFE::OverlayColors::setColorOverlayAnimation().
Referenced by FIFE::Instance::addColorOverlay(), and convertToOverlays().
void FIFE::ActionVisual::addColorOverlay | ( | uint32_t | angle, |
int32_t | order, | ||
const OverlayColors & | colors | ||
) |
Adds new color overlay with given angle (degrees), order and colors.
Note: Works only for AnimationOverlays.
Definition at line 312 of file visual.cpp.
References FIFE::OverlayColors::changeColor(), FIFE::OverlayColors::getColorOverlayAnimation(), FIFE::OverlayColors::getColors(), m_colorAnimationOverlayMap, m_map, and FIFE::OverlayColors::setColorOverlayAnimation().
void FIFE::ActionVisual::convertToOverlays | ( | bool | color | ) |
Convertes animations and optional color overlay to default animation overlay.
The default order value for both is 0. The old data remain, so if you remove the animation overlay the old plain animations and colors be used again.
Definition at line 369 of file visual.cpp.
References addAnimationOverlay(), addColorOverlay(), getAnimationByAngle(), getColorOverlay(), m_colorOverlayMap, and m_map.
Referenced by FIFE::Instance::convertToOverlays().
|
static |
Constructs and assigns it to the passed item.
Definition at line 228 of file visual.cpp.
References ActionVisual(), FIFE::Action::adoptVisual(), and FIFE::Action::getVisual().
Referenced by FIFE::ObjectLoader::load().
void FIFE::ActionVisual::getActionImageAngles | ( | std::vector< int32_t > & | angles | ) |
Returns list of available angles for this Action.
Definition at line 360 of file visual.cpp.
References m_map.
AnimationPtr FIFE::ActionVisual::getAnimationByAngle | ( | int32_t | angle | ) |
Gets index to animation closest to given angle.
Definition at line 245 of file visual.cpp.
References FIFE::getIndexByAngle(), m_animation_map, and m_map.
Referenced by convertToOverlays().
std::map< int32_t, AnimationPtr > FIFE::ActionVisual::getAnimationOverlay | ( | int32_t | angle | ) |
Gets map with animations closest to given angle.
Definition at line 256 of file visual.cpp.
References FIFE::getIndexByAngle(), m_animationOverlayMap, and m_map.
Referenced by FIFE::Instance::getAnimationOverlay(), and FIFE::LayerCache::updateVisual().
OverlayColors * FIFE::ActionVisual::getColorOverlay | ( | int32_t | angle | ) |
Gets OverlayColors for given angle (degrees).
Definition at line 291 of file visual.cpp.
References FIFE::getIndexByAngle(), m_colorOverlayMap, and m_map.
Referenced by convertToOverlays(), FIFE::Instance::getColorOverlay(), and FIFE::LayerCache::updateVisual().
OverlayColors * FIFE::ActionVisual::getColorOverlay | ( | int32_t | angle, |
int32_t | order | ||
) |
Gets OverlayColors for given angle (degrees) and order.
Definition at line 329 of file visual.cpp.
References FIFE::getIndexByAngle(), m_colorAnimationOverlayMap, and m_map.
|
inline |
Returns true if it exists a animation overlay, otherwise false.
Definition at line 284 of file visual.h.
Referenced by FIFE::Instance::isAnimationOverlay(), and FIFE::LayerCache::updateVisual().
|
inline |
Returns true if it exists a color overlay, otherwise false.
Definition at line 288 of file visual.h.
Referenced by FIFE::Instance::isColorOverlay(), and FIFE::LayerCache::updateVisual().
void FIFE::ActionVisual::removeAnimationOverlay | ( | uint32_t | angle, |
int32_t | order | ||
) |
Removes animation overlay with given angle (degrees) and order.
Definition at line 261 of file visual.cpp.
References FIFE::getIndexByAngle(), m_animationOverlayMap, and m_map.
Referenced by FIFE::Instance::removeAnimationOverlay().
void FIFE::ActionVisual::removeColorOverlay | ( | int32_t | angle | ) |
Removes color overlay with given angle (degrees).
Definition at line 303 of file visual.cpp.
References FIFE::getIndexByAngle(), m_colorOverlayMap, and m_map.
Referenced by FIFE::Instance::removeColorOverlay().
void FIFE::ActionVisual::removeColorOverlay | ( | int32_t | angle, |
int32_t | order | ||
) |
Removes color overlay with given angle (degrees) and order.
Definition at line 345 of file visual.cpp.
References FIFE::getIndexByAngle(), m_colorAnimationOverlayMap, and m_map.
|
private |
Definition at line 297 of file visual.h.
Referenced by addAnimation(), and getAnimationByAngle().
|
private |
Definition at line 300 of file visual.h.
Referenced by addAnimationOverlay(), getAnimationOverlay(), and removeAnimationOverlay().
|
private |
Definition at line 306 of file visual.h.
Referenced by addColorOverlay(), getColorOverlay(), and removeColorOverlay().
|
private |
Definition at line 303 of file visual.h.
Referenced by addColorOverlay(), convertToOverlays(), getColorOverlay(), and removeColorOverlay().
|
private |
Definition at line 308 of file visual.h.
Referenced by addAnimation(), addAnimationOverlay(), addColorOverlay(), convertToOverlays(), getActionImageAngles(), getAnimationByAngle(), getAnimationOverlay(), getColorOverlay(), removeAnimationOverlay(), and removeColorOverlay().