FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
#include <coordinaterenderer.h>
Public Member Functions | |
CoordinateRenderer (RenderBackend *renderbackend, int32_t position) | |
Constructor. More... | |
CoordinateRenderer (const CoordinateRenderer &old) | |
Copy Constructor. More... | |
RendererBase * | clone () |
Makes copy of this renderer. More... | |
virtual | ~CoordinateRenderer () |
Destructor. More... | |
void | render (Camera *cam, Layer *layer, RenderList &instances) |
This method is called by the view to ask renderer to draw its rendering aspect based on given parameters. More... | |
std::string | getName () |
Returns the renderer name. More... | |
void | setColor (uint8_t r, uint8_t g, uint8_t b) |
Changes the used color. More... | |
void | setFont (IFont *font) |
Changes default font in the renderer. More... | |
void | setZoom (bool enable) |
Enables / disables zooming for coordinate images, by default it is enabled. More... | |
Public Member Functions inherited from FIFE::RendererBase | |
RendererBase (RenderBackend *renderbackend, int32_t position) | |
Constructor. More... | |
RendererBase (const RendererBase &old) | |
Copy Constructor. More... | |
virtual | ~RendererBase () |
Destructor. More... | |
int32_t | getPipelinePosition () const |
Gets renderer position in the rendering pipeline. More... | |
void | setPipelinePosition (int32_t position) |
Sets renderer position in the rendering pipeline Pipeline position defines in which order view calls the renderers when update occurs Note that renderers are called once per rendered layer, thus to update the whole screen, renderer might receive multiple calls. More... | |
virtual void | setEnabled (bool enabled) |
Enables renderer. More... | |
virtual void | reset () |
Resets information in the renderer. More... | |
bool | isEnabled () const |
Is renderer enabled. More... | |
void | setRendererListener (IRendererListener *listener) |
Sets listener for renderer. More... | |
void | addActiveLayer (Layer *layer) |
Adds active layer to renderer. More... | |
void | removeActiveLayer (Layer *layer) |
Removes active layer from renderer. More... | |
void | clearActiveLayers () |
Clears all active layers from renderer. More... | |
void | activateAllLayers (Map *elevation) |
Activates all layers from given elevation. More... | |
bool | isActivedLayer (Layer *layer) |
Returns if given layer is currently activated. More... | |
std::list< Layer * > | getActiveLayers () const |
Returns list of activated layer. More... | |
Static Public Member Functions | |
static CoordinateRenderer * | getInstance (IRendererContainer *cnt) |
Gets instance for interface access. More... | |
Private Member Functions | |
void | adjustLayerArea () |
Private Attributes | |
Rect | m_layer_area |
Location | m_tmploc |
ExactModelCoordinate | m_c |
IFont * | m_font |
bool | m_font_color |
SDL_Color | m_color |
bool | m_zoom |
Additional Inherited Members | |
Protected Member Functions inherited from FIFE::RendererBase | |
RendererBase () | |
Protected Attributes inherited from FIFE::RendererBase | |
std::list< Layer * > | m_active_layers |
RenderBackend * | m_renderbackend |
Definition at line 40 of file coordinaterenderer.h.
FIFE::CoordinateRenderer::CoordinateRenderer | ( | RenderBackend * | renderbackend, |
int32_t | position | ||
) |
Constructor.
renderbackend | The renderbackend to use. |
position | The position for this renderer in rendering pipeline. @ see setPipelinePosition |
Definition at line 52 of file coordinaterenderer.cpp.
References FIFE::RendererBase::setEnabled().
Referenced by clone().
FIFE::CoordinateRenderer::CoordinateRenderer | ( | const CoordinateRenderer & | old | ) |
Copy Constructor.
Definition at line 63 of file coordinaterenderer.cpp.
References FIFE::RendererBase::setEnabled().
|
virtual |
Destructor.
Definition at line 79 of file coordinaterenderer.cpp.
|
private |
Definition at line 86 of file coordinaterenderer.cpp.
References FIFE::Location::getLayerCoordinates(), FIFE::RectType< T >::h, m_c, m_layer_area, m_tmploc, FIFE::Location::setMapCoordinates(), FIFE::RectType< T >::w, FIFE::RectType< T >::x, FIFE::PointType3D< T >::x, FIFE::RectType< T >::y, and FIFE::PointType3D< T >::y.
Referenced by render(), and setZoom().
|
virtual |
Makes copy of this renderer.
Implements FIFE::RendererBase.
Definition at line 75 of file coordinaterenderer.cpp.
References CoordinateRenderer().
|
static |
Gets instance for interface access.
Definition at line 82 of file coordinaterenderer.cpp.
References FIFE::IRendererContainer::getRenderer().
Referenced by setZoom().
|
inlinevirtual |
Returns the renderer name.
Implements FIFE::RendererBase.
Definition at line 75 of file coordinaterenderer.h.
References setColor().
|
virtual |
This method is called by the view to ask renderer to draw its rendering aspect based on given parameters.
cam | Camera view to draw |
layer | Current layer to be rendered |
instances | Instances on the current layer |
Implements FIFE::RendererBase.
Definition at line 97 of file coordinaterenderer.cpp.
References adjustLayerArea(), FIFE::Math< T >::Equal(), FIFE::IFont::getAsImage(), FIFE::IFont::getColor(), FIFE::Image::getHeight(), FIFE::Location::getMapCoordinates(), FIFE::Camera::getViewPort(), FIFE::Image::getWidth(), FIFE::Camera::getZoom(), FIFE::RectType< T >::h, m_c, m_color, m_font, m_font_color, m_layer_area, m_tmploc, m_zoom, FIFE::MAX_COORD, FIFE::MIN_COORD, FIFE::Image::render(), FIFE::IFont::setColor(), FIFE::Location::setLayer(), FIFE::Location::setLayerCoordinates(), FIFE::Camera::toMapCoordinates(), FIFE::Camera::toScreenCoordinates(), FIFE::RectType< T >::w, FIFE::RectType< T >::x, FIFE::PointType3D< T >::x, FIFE::RectType< T >::y, and FIFE::PointType3D< T >::y.
void FIFE::CoordinateRenderer::setColor | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b | ||
) |
Changes the used color.
r | The value for red, range 0-255. |
g | The value for green, range 0-255. |
b | The value for blue, range 0-255. |
Definition at line 181 of file coordinaterenderer.cpp.
References m_color.
Referenced by getName().
|
inline |
Changes default font in the renderer.
font | Pointer to the font |
Definition at line 90 of file coordinaterenderer.h.
References m_font.
|
inline |
Enables / disables zooming for coordinate images, by default it is enabled.
Definition at line 94 of file coordinaterenderer.h.
References adjustLayerArea(), getInstance(), and m_zoom.
|
private |
Definition at line 105 of file coordinaterenderer.h.
Referenced by adjustLayerArea(), and render().
|
private |
Definition at line 108 of file coordinaterenderer.h.
Referenced by render(), and setColor().
|
private |
Definition at line 106 of file coordinaterenderer.h.
|
private |
Definition at line 107 of file coordinaterenderer.h.
Referenced by render().
|
private |
Definition at line 103 of file coordinaterenderer.h.
Referenced by adjustLayerArea(), and render().
|
private |
Definition at line 104 of file coordinaterenderer.h.
Referenced by adjustLayerArea(), and render().
|
private |
Definition at line 109 of file coordinaterenderer.h.