diff --git a/src/osgWrappers/serializers/osgTerrain/CompositeLayer.cpp b/src/osgWrappers/serializers/osgTerrain/CompositeLayer.cpp index c817c9f9a..4f0caff3c 100644 --- a/src/osgWrappers/serializers/osgTerrain/CompositeLayer.cpp +++ b/src/osgWrappers/serializers/osgTerrain/CompositeLayer.cpp @@ -13,8 +13,19 @@ static bool readLayers( osgDB::InputStream& is, osgTerrain::CompositeLayer& laye unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET; for ( unsigned int i=0; i( is.readObject() ); - if ( child ) layer.addLayer( child ); + std::string type; + is >> type; + if ( type=="Object" ) + { + osgTerrain::Layer* child = dynamic_cast( is.readObject() ); + if ( child ) layer.addLayer( child ); + } + else if ( type=="File" ) + { + std::string compoundname; + is.readWrappedString( compoundname ); + layer.addLayer( compoundname ); + } } is >> osgDB::END_BRACKET; return true; @@ -26,7 +37,18 @@ static bool writeLayers( osgDB::OutputStream& os, const osgTerrain::CompositeLay os << size << osgDB::BEGIN_BRACKET << std::endl; for ( unsigned int i=0; i