From Marco, updates to osgDB and .osg plugin to better handle reading of

objects of specified types.
This commit is contained in:
Robert Osfield
2003-07-21 18:36:47 +00:00
parent 40e38a1645
commit aa8b552ca6
10 changed files with 66 additions and 34 deletions

View File

@@ -42,13 +42,10 @@ bool ShapeDrawable_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
ref_ptr<Object> readObject = fr.readObject();
ref_ptr<Object> readObject = fr.readObjectOfType(type_wrapper<TessellationHints>());
if (readObject.valid()) {
TessellationHints* hints = dynamic_cast<TessellationHints*>(readObject.get());
if (hints)
geom.setTessellationHints(hints);
else
notify(WARN) << "Warning: " << readObject->className() << " loaded but cannot be attached to ShapeDrawable.\n";
TessellationHints* hints = static_cast<TessellationHints*>(readObject.get());
geom.setTessellationHints(hints);
iteratorAdvanced = true;
}