More clean up for synch with 0.8.42

This commit is contained in:
Don BURNS
2001-09-19 21:19:47 +00:00
parent 2462c6273c
commit 7e81f6cfa6
292 changed files with 39673 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
#include <osgUtil/RenderStageLighting>
using namespace osg;
using namespace osgUtil;
// register a RenderStageLighting prototype with the RenderBin prototype list.
//RegisterRenderBinProxy<RenderStageLighting> s_registerRenderStageLightingProxy;
RenderStageLighting::RenderStageLighting()
{
}
RenderStageLighting::~RenderStageLighting()
{
}
void RenderStageLighting::reset()
{
_lightList.clear();
}
void RenderStageLighting::draw(osg::State& state,RenderLeaf*& previous)
{
if (previous)
{
RenderGraph::moveToRootRenderGraph(state,previous->_parent);
state.apply();
if (previous->_matrix.valid()) glPopMatrix();
previous = NULL;
}
Matrix* prev_matrix = NULL;
// apply the light list.
for(LightList::iterator litr=_lightList.begin();
litr!=_lightList.end();
++litr)
{
Matrix* matrix = (*litr).second.get();
if (matrix != prev_matrix)
{
if (prev_matrix) glPopMatrix();
if (matrix)
{
glPushMatrix();
glMultMatrixf((GLfloat*)matrix->_mat);
}
prev_matrix = matrix;
}
// apply the light source.
litr->first->apply(state);
}
// clean up matrix stack.
if (prev_matrix) glPopMatrix();
}