Replaced old style access of ValueObject values to new ValueObject::getScaleValue() methods

This commit is contained in:
Robert Osfield
2018-01-06 13:47:18 +00:00
parent bdff0955dc
commit 2108141b4e
5 changed files with 23 additions and 91 deletions

View File

@@ -121,16 +121,10 @@ struct ResizeDrawElements : public osgDB::MethodObject
{
if (inputParameters.empty()) return false;
osg::Object* indexObject = inputParameters[0].get();
unsigned int index = 0;
osg::DoubleValueObject* dvo = dynamic_cast<osg::DoubleValueObject*>(indexObject);
if (dvo) index = static_cast<unsigned int>(dvo->getValue());
else
{
osg::UIntValueObject* uivo = dynamic_cast<osg::UIntValueObject*>(indexObject);
if (uivo) index = uivo->getValue();
}
osg::ValueObject* indexObject = inputParameters[0]->asValueObject();
if (indexObject) indexObject->getScalarValue(index);
osg::DrawElements* de = reinterpret_cast<osg::DrawElements*>(objectPtr);
de->resizeElements(index);