Moved _stateset = new StateSet instances to setStateSet(new StateSet) to make

sure the wiring up of the StateSet parents is done consistently
This commit is contained in:
Robert Osfield
2008-08-25 10:20:20 +00:00
parent 8d8852bc23
commit ff35465a33
4 changed files with 16 additions and 6 deletions

View File

@@ -19,13 +19,14 @@ using namespace osg;
ClipNode::ClipNode():
_value(StateAttribute::ON)
{
_stateset = new StateSet;
setStateSet(new StateSet);
}
ClipNode::ClipNode(const ClipNode& cn, const CopyOp& copyop):
Group(cn,copyop),
_value(cn._value)
{
setStateSet(new StateSet);
for(ClipPlaneList::const_iterator itr=cn._planes.begin();
itr!=cn._planes.end();
++itr)
@@ -136,7 +137,8 @@ void ClipNode::setStateSetModes(StateSet& stateset,StateAttribute::GLModeValue v
void ClipNode::setLocalStateSetModes(StateAttribute::GLModeValue value)
{
_value = value;
if (!_stateset) _stateset = new StateSet;
if (!_stateset) setStateSet(new StateSet);
setStateSetModes(*_stateset,value);
}