FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::LightRenderer Class Reference

#include <lightrenderer.h>

+ Inheritance diagram for FIFE::LightRenderer:
+ Collaboration diagram for FIFE::LightRenderer:

Public Member Functions

 LightRenderer (RenderBackend *renderbackend, int32_t position)
 constructor. More...
 
 LightRenderer (const LightRenderer &old)
 
RendererBaseclone ()
 Makes copy of this renderer. More...
 
virtual ~LightRenderer ()
 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 ()
 Name of the renderer. More...
 
void addImage (const std::string &group, RendererNode n, ImagePtr image, int32_t src=-1, int32_t dst=-1)
 
void addAnimation (const std::string &group, RendererNode n, AnimationPtr animation, int32_t src=-1, int32_t dst=-1)
 
void addSimpleLight (const std::string &group, RendererNode n, uint8_t intensity, float radius, int32_t subdivisions, float xstretch, float ystretch, uint8_t r, uint8_t g, uint8_t b, int32_t src=-1, int32_t dst=-1)
 
void resizeImage (const std::string &group, RendererNode n, ImagePtr image, int32_t width, int32_t height, int32_t src=-1, int32_t dst=-1)
 
void addStencilTest (const std::string &group, uint8_t stencil_ref=0)
 
void removeStencilTest (const std::string &group)
 
std::list< std::string > getGroups ()
 
std::vector< LightRendererElementInfo * > getLightInfo (const std::string &group)
 
void removeAll (const std::string &group)
 
void removeAll ()
 
void reset ()
 Resets information in the renderer. 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...
 
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 LightRenderergetInstance (IRendererContainer *cnt)
 Gets instance for interface access. More...
 

Private Attributes

std::map< std::string, std::vector< LightRendererElementInfo * > > m_groups
 

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 141 of file lightrenderer.h.

Constructor & Destructor Documentation

◆ LightRenderer() [1/2]

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

constructor.

Parameters
renderbackendto use
positionposition for this renderer in rendering pipeline

Definition at line 204 of file lightrenderer.cpp.

References FIFE::RendererBase::setEnabled().

Referenced by clone().

+ Here is the caller graph for this function:

◆ LightRenderer() [2/2]

FIFE::LightRenderer::LightRenderer ( const LightRenderer old)

Definition at line 209 of file lightrenderer.cpp.

References FIFE::RendererBase::setEnabled().

◆ ~LightRenderer()

FIFE::LightRenderer::~LightRenderer ( )
virtual

Destructor.

Definition at line 217 of file lightrenderer.cpp.

Member Function Documentation

◆ addAnimation()

void FIFE::LightRenderer::addAnimation ( const std::string &  group,
RendererNode  n,
AnimationPtr  animation,
int32_t  src = -1,
int32_t  dst = -1 
)

Definition at line 225 of file lightrenderer.cpp.

References m_groups.

◆ addImage()

void FIFE::LightRenderer::addImage ( const std::string &  group,
RendererNode  n,
ImagePtr  image,
int32_t  src = -1,
int32_t  dst = -1 
)

Definition at line 220 of file lightrenderer.cpp.

References m_groups.

◆ addSimpleLight()

void FIFE::LightRenderer::addSimpleLight ( const std::string &  group,
RendererNode  n,
uint8_t  intensity,
float  radius,
int32_t  subdivisions,
float  xstretch,
float  ystretch,
uint8_t  r,
uint8_t  g,
uint8_t  b,
int32_t  src = -1,
int32_t  dst = -1 
)

Definition at line 230 of file lightrenderer.cpp.

References m_groups.

◆ addStencilTest()

void FIFE::LightRenderer::addStencilTest ( const std::string &  group,
uint8_t  stencil_ref = 0 
)

Definition at line 240 of file lightrenderer.cpp.

References m_groups.

◆ clone()

RendererBase * FIFE::LightRenderer::clone ( )
virtual

Makes copy of this renderer.

Implements FIFE::RendererBase.

Definition at line 214 of file lightrenderer.cpp.

References LightRenderer().

◆ getGroups()

std::list< std::string > FIFE::LightRenderer::getGroups ( )

Definition at line 254 of file lightrenderer.cpp.

References m_groups.

◆ getInstance()

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

Gets instance for interface access.

Definition at line 201 of file lightrenderer.cpp.

References FIFE::IRendererContainer::getRenderer().

◆ getLightInfo()

std::vector< LightRendererElementInfo * > FIFE::LightRenderer::getLightInfo ( const std::string &  group)

Definition at line 265 of file lightrenderer.cpp.

References m_groups.

◆ getName()

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

Name of the renderer.

Implements FIFE::RendererBase.

Definition at line 157 of file lightrenderer.h.

◆ removeAll() [1/2]

void FIFE::LightRenderer::removeAll ( const std::string &  group)

Definition at line 274 of file lightrenderer.cpp.

References m_groups.

◆ removeAll() [2/2]

void FIFE::LightRenderer::removeAll ( )

Definition at line 283 of file lightrenderer.cpp.

References m_groups.

Referenced by reset().

+ Here is the caller graph for this function:

◆ removeStencilTest()

void FIFE::LightRenderer::removeStencilTest ( const std::string &  group)

Definition at line 247 of file lightrenderer.cpp.

References m_groups.

◆ render()

void FIFE::LightRenderer::render ( Camera cam,
Layer layer,
RenderList instances 
)
virtual

This method is called by the view to ask renderer to draw its rendering aspect based on given parameters.

Renderers receive non-clipped instance stack since there is no way to know which information is relevant for the renderer. E.g. effect renderer might need to know offscreen instance locations to be able to draw radiation coming from some instance not visible on the screen.

Parameters
camcamera view to draw
layercurrent layer to be rendered
instancesinstances on the current layer @ see setPipelinePosition

Implements FIFE::RendererBase.

Definition at line 298 of file lightrenderer.cpp.

References FIFE::Layer::areInstancesVisible(), FIFE::RenderBackend::getLightingModel(), m_groups, and FIFE::RendererBase::m_renderbackend.

◆ reset()

void FIFE::LightRenderer::reset ( )
virtual

Resets information in the renderer.

Reimplemented from FIFE::RendererBase.

Definition at line 294 of file lightrenderer.cpp.

References removeAll().

◆ resizeImage()

void FIFE::LightRenderer::resizeImage ( const std::string &  group,
RendererNode  n,
ImagePtr  image,
int32_t  width,
int32_t  height,
int32_t  src = -1,
int32_t  dst = -1 
)

Definition at line 235 of file lightrenderer.cpp.

References m_groups.

Member Data Documentation

◆ m_groups

std::map<std::string, std::vector<LightRendererElementInfo*> > FIFE::LightRenderer::m_groups
private

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