FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::ActionVisual Class Reference

Action visual contains data that is needed to visualize different actions on screen. More...

#include <visual.h>

+ Inheritance diagram for FIFE::ActionVisual:
+ Collaboration diagram for FIFE::ActionVisual:

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, AnimationPtrgetAnimationOverlay (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...
 
OverlayColorsgetColorOverlay (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...
 
OverlayColorsgetColorOverlay (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...
 
- Public Member Functions inherited from FIFE::Visual2DGfx
virtual ~Visual2DGfx ()
 Destructor. More...
 
- Public Member Functions inherited from FIFE::IVisual
virtual ~IVisual ()
 

Static Public Member Functions

static ActionVisualcreate (Action *action)
 Constructs and assigns it to the passed item. More...
 

Private Types

typedef std::map< uint32_t, AnimationPtrAngleAnimationMap
 
typedef std::map< uint32_t, std::map< int32_t, AnimationPtr > > AngleAnimationOverlayMap
 
typedef std::map< uint32_t, OverlayColorsAngleColorOverlayMap
 
typedef std::map< uint32_t, std::map< int32_t, OverlayColors > > AngleColorAnimationOverlayMap
 

Private Member Functions

 ActionVisual ()
 Constructor. More...
 

Private Attributes

AngleAnimationMap m_animation_map
 
AngleAnimationOverlayMap m_animationOverlayMap
 
AngleColorOverlayMap m_colorOverlayMap
 
AngleColorAnimationOverlayMap m_colorAnimationOverlayMap
 
type_angle2id m_map
 

Additional Inherited Members

- Protected Member Functions inherited from FIFE::Visual2DGfx
 Visual2DGfx ()
 Constructor. More...
 

Detailed Description

Action visual contains data that is needed to visualize different actions on screen.

Definition at line 212 of file visual.h.

Member Typedef Documentation

typedef std::map<uint32_t, AnimationPtr> FIFE::ActionVisual::AngleAnimationMap
private

Definition at line 296 of file visual.h.

typedef std::map<uint32_t, std::map<int32_t, AnimationPtr> > FIFE::ActionVisual::AngleAnimationOverlayMap
private

Definition at line 299 of file visual.h.

typedef std::map<uint32_t, std::map<int32_t, OverlayColors> > FIFE::ActionVisual::AngleColorAnimationOverlayMap
private

Definition at line 305 of file visual.h.

typedef std::map<uint32_t, OverlayColors> FIFE::ActionVisual::AngleColorOverlayMap
private

Definition at line 302 of file visual.h.

Constructor & Destructor Documentation

FIFE::ActionVisual::~ActionVisual ( )
virtual

Destructor.

Definition at line 237 of file visual.cpp.

FIFE::ActionVisual::ActionVisual ( )
private

Constructor.

Definition at line 225 of file visual.cpp.

Referenced by create().

+ Here is the caller graph for this function:

Member Function Documentation

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().

+ Here is the caller graph for this function:

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().

+ Here is the caller graph for this function:

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().

+ Here is the caller graph for this function:

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().

+ Here is the caller graph for this function:

ActionVisual * FIFE::ActionVisual::create ( Action action)
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().

+ Here is the caller graph for this function:

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.

Returns
animation index, -1 if no animations available

Definition at line 245 of file visual.cpp.

References FIFE::getIndexByAngle(), m_animation_map, and m_map.

Referenced by convertToOverlays().

+ Here is the caller graph for this function:

std::map< int32_t, AnimationPtr > FIFE::ActionVisual::getAnimationOverlay ( int32_t  angle)

Gets map with animations closest to given angle.

Returns
animation map

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().

+ Here is the caller graph for this function:

OverlayColors * FIFE::ActionVisual::getColorOverlay ( int32_t  angle)

Gets OverlayColors for given angle (degrees).

Returns
pointer to OverlayColors or Null

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().

+ Here is the caller graph for this function:

OverlayColors * FIFE::ActionVisual::getColorOverlay ( int32_t  angle,
int32_t  order 
)

Gets OverlayColors for given angle (degrees) and order.

Returns
pointer to OverlayColors or Null

Definition at line 329 of file visual.cpp.

References FIFE::getIndexByAngle(), m_colorAnimationOverlayMap, and m_map.

bool FIFE::ActionVisual::isAnimationOverlay ( )
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().

+ Here is the caller graph for this function:

bool FIFE::ActionVisual::isColorOverlay ( )
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().

+ Here is the caller graph for this function:

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().

+ Here is the caller graph for this function:

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().

+ Here is the caller graph for this function:

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.

Member Data Documentation

AngleAnimationMap FIFE::ActionVisual::m_animation_map
private

Definition at line 297 of file visual.h.

Referenced by addAnimation(), and getAnimationByAngle().

AngleAnimationOverlayMap FIFE::ActionVisual::m_animationOverlayMap
private

Definition at line 300 of file visual.h.

Referenced by addAnimationOverlay(), getAnimationOverlay(), and removeAnimationOverlay().

AngleColorAnimationOverlayMap FIFE::ActionVisual::m_colorAnimationOverlayMap
private

Definition at line 306 of file visual.h.

Referenced by addColorOverlay(), getColorOverlay(), and removeColorOverlay().

AngleColorOverlayMap FIFE::ActionVisual::m_colorOverlayMap
private

Definition at line 303 of file visual.h.

Referenced by addColorOverlay(), convertToOverlays(), getColorOverlay(), and removeColorOverlay().


The documentation for this class was generated from the following files: