FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
#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... | |
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 LightRenderer * | getInstance (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 |
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 204 of file lightrenderer.cpp.
References FIFE::RendererBase::setEnabled().
Referenced by clone().
FIFE::LightRenderer::LightRenderer | ( | const LightRenderer & | old | ) |
Definition at line 209 of file lightrenderer.cpp.
References FIFE::RendererBase::setEnabled().
|
virtual |
Destructor.
Definition at line 217 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 225 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 220 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 230 of file lightrenderer.cpp.
References m_groups.
void FIFE::LightRenderer::addStencilTest | ( | const std::string & | group, |
uint8_t | stencil_ref = 0 |
||
) |
Definition at line 240 of file lightrenderer.cpp.
References m_groups.
|
virtual |
Makes copy of this renderer.
Implements FIFE::RendererBase.
Definition at line 214 of file lightrenderer.cpp.
References LightRenderer().
std::list< std::string > FIFE::LightRenderer::getGroups | ( | ) |
Definition at line 254 of file lightrenderer.cpp.
References m_groups.
|
static |
Gets instance for interface access.
Definition at line 201 of file lightrenderer.cpp.
References FIFE::IRendererContainer::getRenderer().
std::vector< LightRendererElementInfo * > FIFE::LightRenderer::getLightInfo | ( | const std::string & | group | ) |
Definition at line 265 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 274 of file lightrenderer.cpp.
References m_groups.
void FIFE::LightRenderer::removeAll | ( | ) |
Definition at line 283 of file lightrenderer.cpp.
References m_groups.
Referenced by reset().
void FIFE::LightRenderer::removeStencilTest | ( | const std::string & | group | ) |
Definition at line 247 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 298 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 294 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 235 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().