FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
Object visual contains data that is needed for visualizing objects. More...
#include <visual.h>
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... | |
void | addStaticColorOverlay (uint32_t angle, const OverlayColors &colors) |
Adds new static color overlay with given angle (degrees). More... | |
OverlayColors * | getStaticColorOverlay (int32_t angle) |
Returns closest matching static color overlay for given angle. More... | |
void | removeStaticColorOverlay (int32_t angle) |
Removes a static color overlay with given angle (degrees). 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... | |
bool | isColorOverlay () |
Indicates if there exists a color overlay. 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 ObjectVisual * | create (Object *object) |
Constructs and assigns it to the passed item. More... | |
Private Types | |
typedef std::map< uint32_t, OverlayColors > | AngleColorOverlayMap |
Private Member Functions | |
ObjectVisual () | |
Constructor. More... | |
Private Attributes | |
type_angle2id | m_angle2img |
AngleColorOverlayMap | m_colorOverlayMap |
type_angle2id | m_map |
Additional Inherited Members | |
Protected Member Functions inherited from FIFE::Visual2DGfx | |
Visual2DGfx () | |
Constructor. More... | |
Object visual contains data that is needed for visualizing objects.
|
private |
|
virtual |
Destructor.
Definition at line 110 of file visual.cpp.
|
private |
Constructor.
Definition at line 98 of file visual.cpp.
void FIFE::ObjectVisual::addStaticColorOverlay | ( | uint32_t | angle, |
const OverlayColors & | colors | ||
) |
Adds new static color overlay with given angle (degrees).
Definition at line 122 of file visual.cpp.
References FIFE::OverlayColors::changeColor(), FIFE::OverlayColors::getColorOverlayImage(), FIFE::OverlayColors::getColors(), and FIFE::OverlayColors::setColorOverlayImage().
Referenced by FIFE::Instance::addStaticColorOverlay().
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.
angle | angle for image. 0 degrees starts from right and turns counter-clockwise (normal math notation) |
image_index | index of image to use for given degress |
Definition at line 113 of file visual.cpp.
Referenced by FIFE::ObjectLoader::load().
|
static |
Constructs and assigns it to the passed item.
Definition at line 101 of file visual.cpp.
References FIFE::Object::getVisual().
Referenced by FIFE::Instance::createOwnObject(), and FIFE::ObjectLoader::load().
int32_t FIFE::ObjectVisual::getClosestMatchingAngle | ( | int32_t | angle | ) |
Returns closest matching image angle for given angle.
Definition at line 157 of file visual.cpp.
References FIFE::getIndexByAngle().
OverlayColors * FIFE::ObjectVisual::getStaticColorOverlay | ( | int32_t | angle | ) |
Returns closest matching static color overlay for given angle.
Definition at line 139 of file visual.cpp.
References FIFE::getIndexByAngle().
Referenced by FIFE::Instance::getStaticColorOverlay(), and FIFE::RenderItem::getStaticImageIndexByAngle().
void FIFE::ObjectVisual::getStaticImageAngles | ( | std::vector< int32_t > & | angles | ) |
Returns list of available static image angles for this object.
Definition at line 163 of file visual.cpp.
Referenced by FIFE::MapLoader::load().
int32_t FIFE::ObjectVisual::getStaticImageIndexByAngle | ( | int32_t | angle | ) |
Returns closest matching static image for given angle.
Definition at line 117 of file visual.cpp.
References FIFE::getIndexByAngle().
Referenced by FIFE::RenderItem::getStaticImageIndexByAngle().
|
inline |
Indicates if there exists a color overlay.
Definition at line 141 of file visual.h.
Referenced by FIFE::RenderItem::getStaticImageIndexByAngle(), and FIFE::Instance::isStaticColorOverlay().
void FIFE::ObjectVisual::removeStaticColorOverlay | ( | int32_t | angle | ) |
Removes a static color overlay with given angle (degrees).
Definition at line 147 of file visual.cpp.
References FIFE::getIndexByAngle().
Referenced by FIFE::Instance::removeStaticColorOverlay().
|
private |
|
private |
|
private |