From 9c04527cbe67d58a26e827f0559862d7de0c315e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 16 Mar 2012 13:22:20 +0000 Subject: [PATCH] Fixed the order of setting of CenterMode --- src/osgPlugins/ive/LOD.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/osgPlugins/ive/LOD.cpp b/src/osgPlugins/ive/LOD.cpp index 2d4cfbb9e..8583eff9a 100644 --- a/src/osgPlugins/ive/LOD.cpp +++ b/src/osgPlugins/ive/LOD.cpp @@ -36,7 +36,7 @@ void LOD::write(DataOutputStream* out){ out->writeInt(getCenterMode()); out->writeVec3(getCenter()); - out->writeInt(getRangeMode()); + out->writeInt(getRangeMode()); // Write rangelist int size = getNumRanges(); @@ -66,12 +66,14 @@ void LOD::read(DataInputStream* in){ if ( in->getVersion() > VERSION_0002 ) setRadius(in->readFloat()); - // Read centermode - setCenterMode((osg::LOD::CenterMode)in->readInt()); - setCenter(in->readVec3()); + // Read centermode and center + osg::LOD::CenterMode centerMode = (osg::LOD::CenterMode)in->readInt(); + osg::Vec3 center = in->readVec3(); + setCenter(center); + setCenterMode(centerMode); - if ( in->getVersion() > VERSION_0002 ) - setRangeMode((RangeMode)in->readInt()); + if ( in->getVersion() > VERSION_0002 ) + setRangeMode((RangeMode)in->readInt()); // Read rangelist int size = in->readInt();;