From 22dfe6f8d1482174f3bd6737e445cb70805e49b1 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 28 Apr 2010 20:10:53 +0000 Subject: [PATCH] From John Ivar Haugland and Michael Platings, JIV:"I deleted a line from the ReaderWriterDAE.cpp file that was introduced in rev 11341. I got a crash on this line when the options pointer was NULL." MP:"Good spot John. The next line is also unnecessary and can be removed as well (attached, plus some minor code beautifying)" --- src/osgPlugins/dae/ReaderWriterDAE.cpp | 13 +++++-------- src/osgTerrain/GeometryTechnique.cpp | 4 ++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/osgPlugins/dae/ReaderWriterDAE.cpp b/src/osgPlugins/dae/ReaderWriterDAE.cpp index 43d31dc74..84c8876e6 100644 --- a/src/osgPlugins/dae/ReaderWriterDAE.cpp +++ b/src/osgPlugins/dae/ReaderWriterDAE.cpp @@ -39,10 +39,10 @@ ReaderWriterDAE::readNode(const std::string& fname, bool bOwnDAE = false; DAE* pDAE = NULL; - + if ( options ) pDAE = (DAE*)options->getPluginData("DAE"); - + std::string ext( osgDB::getLowerCaseFileExtension(fname) ); if( ! acceptsExtension(ext) ) return ReadResult::FILE_NOT_HANDLED; @@ -80,7 +80,7 @@ ReaderWriterDAE::readNode(const std::string& fname, *(float*)options->getPluginData("DAE-AssetUnitMeter") = daeReader.getAssetUnitMeter(); if (options->getPluginData("DAE-AssetUp_axis")) *(domUpAxisType*)options->getPluginData("DAE-AssetUp_axis") = daeReader.getAssetUpAxis(); - } + } if (bOwnDAE) delete pDAE; @@ -97,9 +97,6 @@ ReaderWriterDAE::writeNode( const osg::Node& node, { SERIALIZER(); - std::istringstream iss(options->getOptionString()); - std::string opt; - bool bOwnDAE = false; DAE* pDAE = NULL; @@ -161,7 +158,7 @@ ReaderWriterDAE::writeNode( const osg::Node& node, std::string fileURI = ConvertFilePathToColladaCompatibleURI(fname); osg::NodeVisitor::TraversalMode traversalMode = writeExtras ? osg::NodeVisitor::TRAVERSE_ALL_CHILDREN : osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN; - + osgDAE::daeWriter daeWriter(pDAE, fileURI, usePolygon, googleMode, traversalMode, writeExtras, earthTex, zUpAxis, forceTexture); daeWriter.setRootNode( node ); const_cast(&node)->accept( daeWriter ); @@ -172,7 +169,7 @@ ReaderWriterDAE::writeNode( const osg::Node& node, if (pDAE->write(fileURI)) retVal = WriteResult::FILE_SAVED; } - + if ( options ) { if (!bOwnDAE) diff --git a/src/osgTerrain/GeometryTechnique.cpp b/src/osgTerrain/GeometryTechnique.cpp index 6f6bab21c..211a8cb99 100644 --- a/src/osgTerrain/GeometryTechnique.cpp +++ b/src/osgTerrain/GeometryTechnique.cpp @@ -838,6 +838,8 @@ void GeometryTechnique::generateGeometry(BufferData& buffer, Locator* masterLoca // populate vertex and tex coord arrays // VNG.populateCenter(elevationLayer, layerToTexCoordMap); + +#if 0 if (terrain) { TileID tileID = _terrainTile->getTileID(); @@ -954,6 +956,8 @@ void GeometryTechnique::generateGeometry(BufferData& buffer, Locator* masterLoca } #endif } +#endif + osg::ref_ptr skirtVectors = new osg::Vec3Array((*VNG._normals)); VNG.computeNormals();