Changeset 23

Show
Ignore:
Timestamp:
06/26/08 10:58:46
Author:
robert
Message:

Introduced workaround which fixes odd OSX bug relating to the freeing of libxml2 generated data structures (looks like a libxml2 bug).

Fixed the parsing of holding slides so that that both .xml and .p3d extensions are accepted.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/ReadShowFile.cpp

    r11 r23  
    3434        { 
    3535            std::string ext = osgDB::getFileExtension(arguments[pos]); 
    36             if (osgDB::equalCaseInsensitive(ext,"xml"))  
     36            if (osgDB::equalCaseInsensitive(ext,"xml") || osgDB::equalCaseInsensitive(ext,"p3d"))  
    3737            { 
    3838                xmlFiles.push_back(arguments[pos]); 
     
    6161                if (!file.empty()) 
    6262                { 
     63                    std::string path = osgDB::getFilePath(file); 
     64                    if (!path.empty()) 
     65                    { 
     66                        osgDB::getDataFilePathList().push_front(path); 
     67                    } 
     68                     
    6369                    if (p3d::readEnvVars(file)) readVars = true; 
    6470                } 
     
    125131    } 
    126132 
     133 #ifndef __APPLE__ 
     134     
    127135    xmlFreeDoc(doc); 
    128136     
    129     return readVars; 
     137 #endif 
     138     
     139     return readVars; 
    130140} 
    131141 
     
    145155{ 
    146156    std::string ext = osgDB::getFileExtension(filename); 
    147     if (!osgDB::equalCaseInsensitive(ext,"xml") && !osgDB::equalCaseInsensitive(ext,"p3d")) return 0; 
     157    if (!osgDB::equalCaseInsensitive(ext,"xml") && 
     158        !osgDB::equalCaseInsensitive(ext,"p3d")) return 0; 
    148159    return osgDB::readNodeFile(filename, options); 
    149160} 
  • trunk/src/ReaderWriterXML.cpp

    r15 r23  
    12691269    SlideShowConstructor constructor; 
    12701270           
     1271    osgDB::FilePathList previousPaths = osgDB::getDataFilePathList(); 
     1272           
    12711273    bool readSlide = false; 
     1274     
    12721275     
    12731276    xmlChar *key; 
     
    13811384 
    13821385    xmlFreeDoc(doc); 
     1386     
     1387    osgDB::getDataFilePathList() = previousPaths; 
     1388     
    13831389 
    13841390    return constructor.takePresentation();