FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::CoordinateRenderer Class Reference

#include <coordinaterenderer.h>

+ Inheritance diagram for FIFE::CoordinateRenderer:
+ Collaboration diagram for FIFE::CoordinateRenderer:

Public Member Functions

 CoordinateRenderer (RenderBackend *renderbackend, int32_t position)
 Constructor. More...
 
 CoordinateRenderer (const CoordinateRenderer &old)
 Copy Constructor. More...
 
RendererBaseclone ()
 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 CoordinateRenderergetInstance (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
 
IFontm_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
 
RenderBackendm_renderbackend
 

Detailed Description

Definition at line 40 of file coordinaterenderer.h.

Constructor & Destructor Documentation

FIFE::CoordinateRenderer::CoordinateRenderer ( RenderBackend renderbackend,
int32_t  position 
)

Constructor.

Parameters
renderbackendThe renderbackend to use.
positionThe position for this renderer in rendering pipeline. @ see setPipelinePosition

Definition at line 52 of file coordinaterenderer.cpp.

References FIFE::RendererBase::setEnabled().

Referenced by clone().

+ Here is the caller graph for this function:

FIFE::CoordinateRenderer::CoordinateRenderer ( const CoordinateRenderer old)

Copy Constructor.

Definition at line 63 of file coordinaterenderer.cpp.

References FIFE::RendererBase::setEnabled().

FIFE::CoordinateRenderer::~CoordinateRenderer ( )
virtual

Destructor.

Definition at line 79 of file coordinaterenderer.cpp.

Member Function Documentation

void FIFE::CoordinateRenderer::adjustLayerArea ( )
private
RendererBase * FIFE::CoordinateRenderer::clone ( )
virtual

Makes copy of this renderer.

Implements FIFE::RendererBase.

Definition at line 75 of file coordinaterenderer.cpp.

References CoordinateRenderer().

CoordinateRenderer * FIFE::CoordinateRenderer::getInstance ( IRendererContainer cnt)
static

Gets instance for interface access.

Definition at line 82 of file coordinaterenderer.cpp.

References FIFE::IRendererContainer::getRenderer().

Referenced by setZoom().

+ Here is the caller graph for this function:

std::string FIFE::CoordinateRenderer::getName ( )
inlinevirtual

Returns the renderer name.

Returns
The name as string.

Implements FIFE::RendererBase.

Definition at line 75 of file coordinaterenderer.h.

References setColor().

void FIFE::CoordinateRenderer::setColor ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Changes the used color.

Parameters
rThe value for red, range 0-255.
gThe value for green, range 0-255.
bThe value for blue, range 0-255.

Definition at line 181 of file coordinaterenderer.cpp.

References m_color.

Referenced by getName().

+ Here is the caller graph for this function:

void FIFE::CoordinateRenderer::setFont ( IFont font)
inline

Changes default font in the renderer.

Note
that this does not change the font ownership
Parameters
fontPointer to the font

Definition at line 90 of file coordinaterenderer.h.

References m_font.

void FIFE::CoordinateRenderer::setZoom ( bool  enable)
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.

Member Data Documentation

ExactModelCoordinate FIFE::CoordinateRenderer::m_c
private

Definition at line 105 of file coordinaterenderer.h.

Referenced by adjustLayerArea(), and render().

SDL_Color FIFE::CoordinateRenderer::m_color
private

Definition at line 108 of file coordinaterenderer.h.

Referenced by render(), and setColor().

IFont* FIFE::CoordinateRenderer::m_font
private

Definition at line 106 of file coordinaterenderer.h.

Referenced by render(), and setFont().

bool FIFE::CoordinateRenderer::m_font_color
private

Definition at line 107 of file coordinaterenderer.h.

Referenced by render().

Rect FIFE::CoordinateRenderer::m_layer_area
private

Definition at line 103 of file coordinaterenderer.h.

Referenced by adjustLayerArea(), and render().

Location FIFE::CoordinateRenderer::m_tmploc
private

Definition at line 104 of file coordinaterenderer.h.

Referenced by adjustLayerArea(), and render().

bool FIFE::CoordinateRenderer::m_zoom
private

Definition at line 109 of file coordinaterenderer.h.

Referenced by render(), and setZoom().


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