FIFE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FIFE::ObjectVisual Class Reference

Object visual contains data that is needed for visualizing objects. More...

#include <visual.h>

+ Inheritance diagram for FIFE::ObjectVisual:
+ Collaboration diagram for FIFE::ObjectVisual:

Public Member Functions

virtual ~ObjectVisual ()
 Destructor. More...
 
void addStaticImage (uint32_t angle, int32_t image_index)
 Adds new static image with given angle (degrees) Static images are used in case there are no actions active in the instance There can be several static images for different angles, that are used in case view / layer is rotated In case there are no exact matches for current view angles, closest one is used. More...
 
int32_t getStaticImageIndexByAngle (int32_t angle)
 Returns closest matching static image for given angle. More...
 
int32_t getClosestMatchingAngle (int32_t angle)
 Returns closest matching image angle for given angle. More...
 
void getStaticImageAngles (std::vector< int32_t > &angles)
 Returns list of available static image angles for this object. 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 ObjectVisualcreate (Object *object)
 Constructs and assigns it to the passed item. More...
 

Private Member Functions

 ObjectVisual ()
 Constructor. More...
 

Private Attributes

type_angle2id m_angle2img
 

Additional Inherited Members

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

Detailed Description

Object visual contains data that is needed for visualizing objects.

Definition at line 65 of file visual.h.

Constructor & Destructor Documentation

FIFE::ObjectVisual::~ObjectVisual ( )
virtual

Destructor.

Definition at line 64 of file visual.cpp.

FIFE::ObjectVisual::ObjectVisual ( )
private

Constructor.

Definition at line 52 of file visual.cpp.

Referenced by create().

+ Here is the caller graph for this function:

Member Function Documentation

void FIFE::ObjectVisual::addStaticImage ( uint32_t  angle,
int32_t  image_index 
)

Adds new static image with given angle (degrees) Static images are used in case there are no actions active in the instance There can be several static images for different angles, that are used in case view / layer is rotated In case there are no exact matches for current view angles, closest one is used.

Parameters
angleangle for image. 0 degrees starts from right and turns counter-clockwise (normal math notation)
image_indexindex of image to use for given degress

Definition at line 67 of file visual.cpp.

References m_angle2img.

Referenced by FIFE::ObjectLoader::load(), and FIFE::AtlasLoader::parseObject().

+ Here is the caller graph for this function:

ObjectVisual * FIFE::ObjectVisual::create ( Object object)
static

Constructs and assigns it to the passed item.

Definition at line 55 of file visual.cpp.

References FIFE::Object::getVisual(), and ObjectVisual().

Referenced by FIFE::ObjectLoader::load(), and FIFE::AtlasLoader::parseObject().

+ Here is the caller graph for this function:

int32_t FIFE::ObjectVisual::getClosestMatchingAngle ( int32_t  angle)

Returns closest matching image angle for given angle.

Returns
closest matching angle

Definition at line 76 of file visual.cpp.

References FIFE::getIndexByAngle(), and m_angle2img.

void FIFE::ObjectVisual::getStaticImageAngles ( std::vector< int32_t > &  angles)

Returns list of available static image angles for this object.

Definition at line 82 of file visual.cpp.

References m_angle2img.

Referenced by FIFE::MapLoader::load().

+ Here is the caller graph for this function:

int32_t FIFE::ObjectVisual::getStaticImageIndexByAngle ( int32_t  angle)

Returns closest matching static image for given angle.

Returns
id for static image

Definition at line 71 of file visual.cpp.

References FIFE::getIndexByAngle(), and m_angle2img.

Member Data Documentation

type_angle2id FIFE::ObjectVisual::m_angle2img
private

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