Moved the set/getName() support from osg::Node etc into the osg::Obejct

base class
This commit is contained in:
Robert Osfield
2005-06-08 13:16:19 +00:00
parent 69cd27e37f
commit 27c4c6a956
19 changed files with 135 additions and 122 deletions

View File

@@ -30,7 +30,10 @@ void Shader::write(DataOutputStream* out){
else
throw Exception("Shader::write(): Could not cast this osg::Shader to an osg::Object.");
out->writeString(getName());
if ( out->getVersion() < VERSION_0012 )
{
out->writeString(getName());
}
out->writeInt(getType());
out->writeString(getShaderSource());
@@ -59,8 +62,12 @@ void Shader::read(DataInputStream* in)
throw Exception("Shader::read(): Expected Shader identification.");
}
setName(in->readString());
setType(static_cast<Type>(in->readInt()));
setShaderSource(in->readString());
if ( in->getVersion() < VERSION_0012 )
{
setName(in->readString());
}
setType(static_cast<Type>(in->readInt()));
setShaderSource(in->readString());
}