From Eric Wing, fixes for "warning: converting of negative value '-0x00000000000000001' to 'unsigned int'"
This commit is contained in:
@@ -149,7 +149,7 @@ osg::Node* createMirroredScene(osg::Node* model)
|
||||
// set up the stencil ops so that the stencil buffer get set at
|
||||
// the mirror plane
|
||||
osg::Stencil* stencil = new osg::Stencil;
|
||||
stencil->setFunction(osg::Stencil::ALWAYS,1,~0);
|
||||
stencil->setFunction(osg::Stencil::ALWAYS,1,~0u);
|
||||
stencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::REPLACE);
|
||||
|
||||
// switch off the writing to the color bit planes.
|
||||
@@ -176,7 +176,7 @@ osg::Node* createMirroredScene(osg::Node* model)
|
||||
// occludes the mirror.
|
||||
{
|
||||
osg::Stencil* stencil = new osg::Stencil;
|
||||
stencil->setFunction(osg::Stencil::ALWAYS,0,~0);
|
||||
stencil->setFunction(osg::Stencil::ALWAYS,0,~0u);
|
||||
stencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::REPLACE);
|
||||
|
||||
osg::StateSet* statesetBin2 = new osg::StateSet();
|
||||
@@ -196,7 +196,7 @@ osg::Node* createMirroredScene(osg::Node* model)
|
||||
|
||||
// set up the stencil ops so that only operator on this mirrors stencil value.
|
||||
osg::Stencil* stencil = new osg::Stencil;
|
||||
stencil->setFunction(osg::Stencil::EQUAL,1,~0);
|
||||
stencil->setFunction(osg::Stencil::EQUAL,1,~0u);
|
||||
stencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::KEEP);
|
||||
|
||||
// switch off the writing to the color bit planes.
|
||||
@@ -254,7 +254,7 @@ osg::Node* createMirroredScene(osg::Node* model)
|
||||
dstate->setMode(GL_CULL_FACE,osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF);
|
||||
|
||||
osg::Stencil* stencil = new osg::Stencil;
|
||||
stencil->setFunction(osg::Stencil::EQUAL,1,~0);
|
||||
stencil->setFunction(osg::Stencil::EQUAL,1,~0u);
|
||||
stencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::KEEP);
|
||||
dstate->setAttributeAndModes(stencil,osg::StateAttribute::ON);
|
||||
|
||||
@@ -281,7 +281,7 @@ osg::Node* createMirroredScene(osg::Node* model)
|
||||
depth->setFunction(osg::Depth::ALWAYS);
|
||||
|
||||
osg::Stencil* stencil = new osg::Stencil;
|
||||
stencil->setFunction(osg::Stencil::EQUAL,1,~0);
|
||||
stencil->setFunction(osg::Stencil::EQUAL,1,~0u);
|
||||
stencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::ZERO);
|
||||
|
||||
// set up additive blending.
|
||||
|
||||
@@ -19,7 +19,7 @@ Stencil::Stencil()
|
||||
// set up same defaults as glStencilFunc.
|
||||
_func = ALWAYS;
|
||||
_funcRef = 0;
|
||||
_funcMask = ~0;
|
||||
_funcMask = ~0u;
|
||||
|
||||
// set up same defaults as glStencilOp.
|
||||
_sfail = KEEP;
|
||||
@@ -27,7 +27,7 @@ Stencil::Stencil()
|
||||
_zpass = KEEP;
|
||||
|
||||
// set up same defaults as glStencilMask.
|
||||
_writeMask = ~0;
|
||||
_writeMask = ~0u;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ void GeoClipRegion::addClipNode(osg::Node *gd) {
|
||||
// add clip node(s) to set stencil bit marking the clip area.
|
||||
// stencil op so that the stencil buffer get set at the clip pixels
|
||||
osg::Stencil* stencil = new osg::Stencil;
|
||||
stencil->setFunction(osg::Stencil::ALWAYS,1,~0);
|
||||
stencil->setFunction(osg::Stencil::ALWAYS,1,~0u);
|
||||
stencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::REPLACE);
|
||||
state->setAttributeAndModes(stencil,osg::StateAttribute::ON);
|
||||
|
||||
@@ -74,7 +74,7 @@ bool GeoClipRegion::addClippedChild( osg::Node *child )
|
||||
osg::StateSet *state=child->getOrCreateStateSet();
|
||||
// state tests pixels against the set stencil.
|
||||
osg::Stencil* stenciltest = new osg::Stencil;
|
||||
stenciltest->setFunction(osg::Stencil::EQUAL,1,~0);
|
||||
stenciltest->setFunction(osg::Stencil::EQUAL,1,~0u);
|
||||
stenciltest->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::KEEP);
|
||||
state->setAttributeAndModes(stenciltest,osg::StateAttribute::ON);
|
||||
|
||||
@@ -97,7 +97,7 @@ bool GeoClipRegion::addObscuredChild( osg::Node *child )
|
||||
osg::StateSet *state=child->getOrCreateStateSet();
|
||||
// state tests pixels against the set stencil.
|
||||
osg::Stencil* stenciltest = new osg::Stencil;
|
||||
stenciltest->setFunction(osg::Stencil::NOTEQUAL,1,~0);
|
||||
stenciltest->setFunction(osg::Stencil::NOTEQUAL,1,~0u);
|
||||
stenciltest->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::KEEP);
|
||||
state->setAttributeAndModes(stenciltest,osg::StateAttribute::ON);
|
||||
|
||||
@@ -124,7 +124,7 @@ void GeoClipRegion::addDrawClipNode(osg::Node *ndclip)
|
||||
depth->setFunction(osg::Depth::ALWAYS);
|
||||
|
||||
osg::Stencil* stencil = new osg::Stencil;
|
||||
stencil->setFunction(osg::Stencil::EQUAL,1,~0);
|
||||
stencil->setFunction(osg::Stencil::EQUAL,1,~0u);
|
||||
stencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, osg::Stencil::ZERO);
|
||||
|
||||
// set up additive blending.
|
||||
|
||||
@@ -400,28 +400,33 @@ void RenderBin::drawImplementation(osg::State& state,RenderLeaf*& previous)
|
||||
|
||||
// stats
|
||||
bool RenderBin::getStats(Statistics* primStats)
|
||||
{ // different by return type - collects the stats in this renderrBin
|
||||
bool somestats=false;
|
||||
{
|
||||
// different by return type - collects the stats in this renderrBin
|
||||
bool somestats=false;
|
||||
|
||||
// draw fine grained ordering.
|
||||
for(RenderLeafList::iterator dw_itr = _renderLeafList.begin();
|
||||
dw_itr != _renderLeafList.end();
|
||||
++dw_itr)
|
||||
{
|
||||
RenderLeaf* rl = *dw_itr;
|
||||
Drawable* dw= rl->_drawable;
|
||||
primStats->addDrawable(); // number of geosets
|
||||
if (rl->_modelview.get()) primStats->addMatrix(); // number of matrices
|
||||
if (dw)
|
||||
RenderLeaf* rl = *dw_itr;
|
||||
Drawable* dw= rl->_drawable;
|
||||
primStats->addDrawable(); // number of geosets
|
||||
if (rl->_modelview.get())
|
||||
{
|
||||
// then tot up the primtive types and no vertices.
|
||||
dw->accept(*primStats); // use sub-class to find the stats for each drawable
|
||||
primStats->addMatrix(); // number of matrices
|
||||
}
|
||||
somestats = true;
|
||||
|
||||
if (dw)
|
||||
{
|
||||
// then tot up the primtive types and no vertices.
|
||||
dw->accept(*primStats); // use sub-class to find the stats for each drawable
|
||||
}
|
||||
somestats = true;
|
||||
|
||||
}
|
||||
|
||||
for(StateGraphList::iterator oitr=_stateGraphList.begin();
|
||||
for(StateGraphList::iterator oitr=_stateGraphList.begin();
|
||||
oitr!=_stateGraphList.end();
|
||||
++oitr)
|
||||
{
|
||||
|
||||
@@ -1081,10 +1081,10 @@ void SceneView::draw()
|
||||
glLoadIdentity();
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glStencilMask(~0);
|
||||
glStencilMask(~0u);
|
||||
glClear(GL_STENCIL_BUFFER_BIT);
|
||||
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
|
||||
glStencilFunc(GL_ALWAYS, 1, ~0);
|
||||
glStencilFunc(GL_ALWAYS, 1, ~0u);
|
||||
glPolygonStipple(patternVertEven);
|
||||
glEnable(GL_POLYGON_STIPPLE);
|
||||
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||
@@ -1103,10 +1103,10 @@ void SceneView::draw()
|
||||
_renderStageRight->setClearMask(_renderStageRight->getClearMask() & ~(GL_STENCIL_BUFFER_BIT|GL_COLOR_BUFFER_BIT));
|
||||
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
|
||||
glStencilFunc(GL_EQUAL, 0, ~0);
|
||||
glStencilFunc(GL_EQUAL, 0, ~0u);
|
||||
_renderStageLeft->draw(*_state,previous);
|
||||
|
||||
glStencilFunc(GL_NOTEQUAL, 0, ~0);
|
||||
glStencilFunc(GL_NOTEQUAL, 0, ~0u);
|
||||
_renderStageRight->draw(*_state,previous);
|
||||
glDisable(GL_STENCIL_TEST);
|
||||
}
|
||||
@@ -1146,10 +1146,10 @@ void SceneView::draw()
|
||||
glLoadIdentity();
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glStencilMask(~0);
|
||||
glStencilMask(~0u);
|
||||
glClear(GL_STENCIL_BUFFER_BIT);
|
||||
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
|
||||
glStencilFunc(GL_ALWAYS, 1, ~0);
|
||||
glStencilFunc(GL_ALWAYS, 1, ~0u);
|
||||
glPolygonStipple(patternHorzEven);
|
||||
glEnable(GL_POLYGON_STIPPLE);
|
||||
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||
@@ -1168,10 +1168,10 @@ void SceneView::draw()
|
||||
_renderStageRight->setClearMask(_renderStageRight->getClearMask() & ~(GL_STENCIL_BUFFER_BIT|GL_COLOR_BUFFER_BIT));
|
||||
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
|
||||
glStencilFunc(GL_EQUAL, 0, ~0);
|
||||
glStencilFunc(GL_EQUAL, 0, ~0u);
|
||||
_renderStageLeft->draw(*_state,previous);
|
||||
|
||||
glStencilFunc(GL_NOTEQUAL, 0, ~0);
|
||||
glStencilFunc(GL_NOTEQUAL, 0, ~0u);
|
||||
_renderStageRight->draw(*_state,previous);
|
||||
glDisable(GL_STENCIL_TEST);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user