From d6fe337728070d599c404e492be06309fd493586 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 15 Sep 2010 11:10:10 +0000 Subject: [PATCH] Renamed file3ds and options member variables to _file3ds and _options to avoid confusion and keep the code consistent with the rest of the class/OSG. Added _option parameter to writeImageFile(..) call. --- src/osgPlugins/3ds/WriterNodeVisitor.cpp | 16 ++++++++-------- src/osgPlugins/3ds/WriterNodeVisitor.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/osgPlugins/3ds/WriterNodeVisitor.cpp b/src/osgPlugins/3ds/WriterNodeVisitor.cpp index 75946897b..e2e1833b9 100644 --- a/src/osgPlugins/3ds/WriterNodeVisitor.cpp +++ b/src/osgPlugins/3ds/WriterNodeVisitor.cpp @@ -503,12 +503,12 @@ WriterNodeVisitor::WriterNodeVisitor(Lib3dsFile * file3ds, const std::string & f osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), _succeeded(true), _srcDirectory(srcDirectory), - file3ds(file3ds), + _file3ds(file3ds), _currentStateSet(new osg::StateSet()), _lastMaterialIndex(0), _lastMeshIndex(0), _cur3dsNode(NULL), - options(options), + _options(options), _imageCount(0), _extendedFilePaths(false) { @@ -531,7 +531,7 @@ WriterNodeVisitor::WriterNodeVisitor(Lib3dsFile * file3ds, const std::string & f void WriterNodeVisitor::writeMaterials() { unsigned int nbMat = _materialMap.size(); - lib3ds_file_reserve_materials(file3ds, nbMat, 1); + lib3ds_file_reserve_materials(_file3ds, nbMat, 1); // Ugly thing: it seems lib3ds_file_insert_material() doesn't support insertion in a random order (else materials are not assigned the right way) for (unsigned int iMat=0; iMatsecond.index); + lib3ds_file_insert_material(_file3ds, mat3ds, itr->second.index); break; // Ugly thing (3) } assert(found); // Ugly thing (4) - Implementation error if !found @@ -795,11 +795,11 @@ WriterNodeVisitor::buildMesh(osg::Geode & geo, mesh->texcos[it->second][1] = vecs[it->first.first][1]; } } - lib3ds_file_insert_mesh(file3ds, mesh, _lastMeshIndex); + lib3ds_file_insert_mesh(_file3ds, mesh, _lastMeshIndex); ++_lastMeshIndex; Lib3dsMeshInstanceNode * node3ds = lib3ds_node_new_mesh_instance(mesh, mesh->name, NULL, NULL, NULL); - lib3ds_file_append_node(file3ds, reinterpret_cast(node3ds), reinterpret_cast(_cur3dsNode)); + lib3ds_file_append_node(_file3ds, reinterpret_cast(node3ds), reinterpret_cast(_cur3dsNode)); } unsigned int @@ -1066,7 +1066,7 @@ void WriterNodeVisitor::apply3DSMatrixNode(osg::Node &node, const osg::Matrix * node3ds = lib3ds_node_new_mesh_instance(NULL, getUniqueName(node.getName().empty() ? node.className() : node.getName(), prefix).c_str(), NULL, NULL, NULL); } - lib3ds_file_append_node(file3ds, reinterpret_cast(node3ds), reinterpret_cast(parent)); + lib3ds_file_append_node(_file3ds, reinterpret_cast(node3ds), reinterpret_cast(parent)); _cur3dsNode = node3ds; } diff --git a/src/osgPlugins/3ds/WriterNodeVisitor.h b/src/osgPlugins/3ds/WriterNodeVisitor.h index 76743f8b6..ebf7471ad 100644 --- a/src/osgPlugins/3ds/WriterNodeVisitor.h +++ b/src/osgPlugins/3ds/WriterNodeVisitor.h @@ -201,7 +201,7 @@ class WriterNodeVisitor: public osg::NodeVisitor bool _succeeded; std::string _directory; std::string _srcDirectory; - Lib3dsFile * file3ds; + Lib3dsFile * _file3ds; StateSetStack _stateSetStack; osg::ref_ptr _currentStateSet; std::map _mapPrefix; ///< List of next number to use in unique name generation, for each prefix @@ -210,7 +210,7 @@ class WriterNodeVisitor: public osg::NodeVisitor unsigned int _lastMaterialIndex; unsigned int _lastMeshIndex; Lib3dsMeshInstanceNode * _cur3dsNode; - const osgDB::ReaderWriter::Options* options; + const osgDB::ReaderWriter::Options* _options; unsigned int _imageCount; bool _extendedFilePaths; std::set _imageSet;