- Timestamp:
- 02/26/10 10:23:28 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/txp/ReaderWriterTXP.cpp
r11037 r11122 59 59 //the txpNode. 60 60 int id = ++_archiveId; 61 TXPArchive*archive = getArchive(id,osgDB::getFilePath(fileName));61 osg::ref_ptr< TXPArchive > archive = getArchive(id,osgDB::getFilePath(fileName)); 62 62 63 63 if (archive != NULL) … … 70 70 } 71 71 72 txpNode->loadArchive(archive );73 72 txpNode->loadArchive(archive.get()); 73 74 74 return txpNode.get(); 75 75 } … … 86 86 unsigned int id; 87 87 sscanf(name.c_str(),"tile%d_%dx%d_%u",&lod,&x,&y,&id); 88 TXPArchive*archive = getArchive(id,osgDB::getFilePath(file));88 osg::ref_ptr< TXPArchive > archive = getArchive(id,osgDB::getFilePath(file)); 89 89 90 90 // The way this is done a 'tile' should only be created for lod 0 only, … … 107 107 108 108 std::vector<TXPArchive::TileLocationInfo> childrenLoc; 109 osg::ref_ptr<osg::Node> tileContent = getTileContent(info,x,y,lod,archive , childrenLoc);109 osg::ref_ptr<osg::Node> tileContent = getTileContent(info,x,y,lod,archive.get(), childrenLoc); 110 110 111 111 tileContent->setName("TileContent"); … … 199 199 unsigned int id; 200 200 sscanf(name.c_str(),"subtiles%d_%dx%d_%u",&lod,&x,&y,&id); 201 TXPArchive*archive = getArchive(id,osgDB::getFilePath(file));201 osg::ref_ptr< TXPArchive > archive = getArchive(id,osgDB::getFilePath(file)); 202 202 203 203 int majorVersion, minorVersion; … … 259 259 continue; 260 260 261 osg::ref_ptr<osg::Node> tileContent = getTileContent(info, loc, archive , childrenChildLoc);261 osg::ref_ptr<osg::Node> tileContent = getTileContent(info, loc, archive.get(), childrenChildLoc); 262 262 263 263 tileContent->setName("TileContent"); … … 361 361 continue; 362 362 363 osg::ref_ptr<osg::Node> tileContent = getTileContent(info,tileX,tileY,tileLOD,archive , childrenLoc);363 osg::ref_ptr<osg::Node> tileContent = getTileContent(info,tileX,tileY,tileLOD,archive.get(), childrenLoc); 364 364 365 365 tileContent->setName("TileContent"); … … 564 564 } 565 565 566 TXPArchive *ReaderWriterTXP::getArchive(int id, const std::string& dir)567 { 568 TXPArchive*archive = NULL;566 osg::ref_ptr< TXPArchive > ReaderWriterTXP::getArchive(int id, const std::string& dir) 567 { 568 osg::ref_ptr< TXPArchive > archive = NULL; 569 569 570 570 std::map< int,osg::ref_ptr<TXPArchive> >::iterator iter = _archives.find(id);
