FIFE
|
#include <lightrenderer.h>
Public Member Functions | |
LightRenderer (RenderBackend *renderbackend, int32_t position) | |
constructor. More... | |
LightRenderer (const LightRenderer &old) | |
RendererBase * | clone () |
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... | |
![]() | |
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 LightRenderer * | getInstance (IRendererContainer *cnt) |
Gets instance for interface access. More... | |
Private Attributes | |
std::map< std::string, std::vector < LightRendererElementInfo * > > | m_groups |
Additional Inherited Members | |
![]() | |
RendererBase () | |
![]() | |
std::list< Layer * > | m_active_layers |
RenderBackend * | m_renderbackend |
Definition at line 141 of file lightrenderer.h.
FIFE::LightRenderer::LightRenderer | ( | RenderBackend * | renderbackend, |
int32_t | position | ||
) |
constructor.
renderbackend | to use |
position | position for this renderer in rendering pipeline |
Definition at line 206 of file lightrenderer.cpp.
References FIFE::RendererBase::setEnabled().
Referenced by clone().
FIFE::LightRenderer::LightRenderer | ( | const LightRenderer & | old | ) |
Definition at line 211 of file lightrenderer.cpp.
References FIFE::RendererBase::setEnabled().
|
virtual |
Destructor.
Definition at line 219 of file lightrenderer.cpp.
void FIFE::LightRenderer::addAnimation | ( | const std::string & | group, |
RendererNode | n, | ||
AnimationPtr | animation, | ||
int32_t | src = -1 , |
||
int32_t | dst = -1 |
||
) |
Definition at line 227 of file lightrenderer.cpp.
References m_groups.
void FIFE::LightRenderer::addImage | ( | const std::string & | group, |
RendererNode | n, | ||
ImagePtr | image, | ||
int32_t | src = -1 , |
||
int32_t | dst = -1 |
||
) |
Definition at line 222 of file lightrenderer.cpp.
References m_groups.
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 232 of file lightrenderer.cpp.
References m_groups.
void FIFE::LightRenderer::addStencilTest | ( | const std::string & | group, |
uint8_t | stencil_ref = 0 |
||
) |
Definition at line 242 of file lightrenderer.cpp.
References m_groups.
|
virtual |
Makes copy of this renderer.
Implements FIFE::RendererBase.
Definition at line 216 of file lightrenderer.cpp.
References LightRenderer().
std::list< std::string > FIFE::LightRenderer::getGroups | ( | ) |
Definition at line 256 of file lightrenderer.cpp.
References m_groups.
|
static |
Gets instance for interface access.
Definition at line 203 of file lightrenderer.cpp.
References FIFE::IRendererContainer::getRenderer().
std::vector< LightRendererElementInfo * > FIFE::LightRenderer::getLightInfo | ( | const std::string & | group | ) |
Definition at line 267 of file lightrenderer.cpp.
References m_groups.
|
inlinevirtual |
Name of the renderer.
Implements FIFE::RendererBase.
Definition at line 157 of file lightrenderer.h.
void FIFE::LightRenderer::removeAll | ( | const std::string & | group | ) |
Definition at line 276 of file lightrenderer.cpp.
References m_groups.
void FIFE::LightRenderer::removeAll | ( | ) |
Definition at line 285 of file lightrenderer.cpp.
References m_groups.
Referenced by reset().
void FIFE::LightRenderer::removeStencilTest | ( | const std::string & | group | ) |
Definition at line 249 of file lightrenderer.cpp.
References m_groups.
|
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.
cam | camera view to draw |
layer | current layer to be rendered |
instances | instances on the current layer @ see setPipelinePosition |
Implements FIFE::RendererBase.
Definition at line 293 of file lightrenderer.cpp.
References FIFE::Layer::areInstancesVisible(), FIFE::RenderBackend::getLightingModel(), m_groups, and FIFE::RendererBase::m_renderbackend.
|
virtual |
Resets information in the renderer.
Reimplemented from FIFE::RendererBase.
Definition at line 289 of file lightrenderer.cpp.
References removeAll().
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 237 of file lightrenderer.cpp.
References m_groups.
|
private |
Definition at line 176 of file lightrenderer.h.
Referenced by addAnimation(), addImage(), addSimpleLight(), addStencilTest(), getGroups(), getLightInfo(), removeAll(), removeStencilTest(), render(), and resizeImage().