From d4e1a8d6a3ca6136aa8ebbce5f5d7e524bf5a515 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 28 Jun 2013 14:32:12 +0000 Subject: [PATCH] From Lilin Xiong, "When writing proxyNode to ive file, we forget "LoadingExternalReferenceMode ". Add some code to fix this. if (out->getVersion() >= VERSION_0045) { out->writeInt(getLoadingExternalReferenceMode()); } if (in->getVersion() >= VERSION_0045) { setLoadExternalReferenceFiles( (osg::ProxyNode::LoadingExternalReferenceMode)in->readInt() ); } " --- src/osgPlugins/ive/IveVersion.h | 3 ++- src/osgPlugins/ive/ProxyNode.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/ive/IveVersion.h b/src/osgPlugins/ive/IveVersion.h index d47cbaaeb..6c95109ba 100644 --- a/src/osgPlugins/ive/IveVersion.h +++ b/src/osgPlugins/ive/IveVersion.h @@ -53,8 +53,9 @@ #define VERSION_0042 42 #define VERSION_0043 43 #define VERSION_0044 44 +#define VERSION_0045 45 -#define VERSION VERSION_0044 +#define VERSION VERSION_0045 /* The BYTE_SEX tag is used to check the endian of the IVE file being read in. The IVE format diff --git a/src/osgPlugins/ive/ProxyNode.cpp b/src/osgPlugins/ive/ProxyNode.cpp index 475436396..cba0bab3d 100644 --- a/src/osgPlugins/ive/ProxyNode.cpp +++ b/src/osgPlugins/ive/ProxyNode.cpp @@ -63,6 +63,11 @@ void ProxyNode::write(DataOutputStream* out) out->writeInt(getCenterMode()); out->writeVec3(getCenter()); + if (out->getVersion() >= VERSION_0045) + { + out->writeInt(getLoadingExternalReferenceMode()); + } + out->writeUInt(getNumFileNames()); unsigned int numChildrenToWriteOut = 0; unsigned int i; @@ -171,6 +176,11 @@ void ProxyNode::read(DataInputStream* in) setCenterMode((osg::ProxyNode::CenterMode)in->readInt()); setCenter(in->readVec3()); + if (in->getVersion() >= VERSION_0045) + { + setLoadingExternalReferenceMode( (osg::ProxyNode::LoadingExternalReferenceMode)in->readInt() ); + } + unsigned int numFileNames = in->readUInt(); unsigned int i; for(i=0; i