Show
Ignore:
Timestamp:
01/08/10 11:52:03 (3 years ago)
Author:
robert
Message:

From Sukender, "ReaderWriter?3DS.cpp fixes:
- Fixed creation of useless intermediate nodes

WriterNodeVisitor?.cpp fixes:
- Fixed naming of textures (path and extension)
"

Note from Robert Osfield, this submission also came with changes to use of ref_ptr<> and removal of delete[]'s, but these were not merged as they didn't actually fix any memory leaks, and in once instance introduced one.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/3ds/ReaderWriter3DS.cpp

    r10914 r10932  
    349349    { 
    350350        if (mesh->faces[i].material>=0) { 
    351             //std::stringstream materialStr; 
    352             //materialStr << mesh->faces[i].material; 
    353             //materialFaceMap[materialStr.str()].push_back(i); 
    354351            materialFaceMap[mesh->faces[i].material].push_back(i); 
    355352        } 
     
    454451 
    455452 
    456     if (node->childs != NULL || pivoted || (!isOsgNodeMatrixIdentity && !noMatrixTransforms)) { 
     453    //if (node->childs != NULL || pivoted || (!isOsgNodeMatrixIdentity && !noMatrixTransforms)) { 
     454    if (node->childs != NULL || (!isOsgNodeMatrixIdentity && !noMatrixTransforms)) { 
    457455        if (isOsgNodeMatrixIdentity || noMatrixTransforms) { 
    458456            group = new osg::Group; 
     
    889887        osg::notify(osg::DEBUG_INFO) << "    LIB3DS_TEXTURE_RGB_TINT     "<<((texture->flags)&LIB3DS_TEXTURE_RGB_TINT)<< std::endl; 
    890888 
    891         bool noTexture = false; 
    892         if (options) 
    893         { 
    894             std::istringstream iss(options->getOptionString()); 
    895             std::string opt; 
    896             while (iss >> opt) 
    897             { 
    898                 if (opt == "noTexture") 
    899                     noTexture = true; 
    900             } 
    901         } 
    902  
    903         osg::ref_ptr<osg::Image> osg_image = NULL; 
    904         if(noTexture) 
    905             osg_image = new osg::Image(); 
    906         else 
    907             osg_image = osgDB::readRefImageFile(fileName.c_str(), options); //Absolute Path 
    908         if (!osg_image) 
     889        osg::ref_ptr<osg::Image> osg_image = osgDB::readRefImageFile(fileName.c_str(), options); //Absolute Path 
     890        if (!osg_image.valid()) 
    909891        { 
    910892            osg::notify(osg::NOTICE) << "Warning: Cannot create texture "<<texture->name<< std::endl;