Hi Falko, Jan, et. al,

On Mon, Jul 13, 2009 at 8:53 PM, Jan Ciger<[email protected]> wrote:
>> Also, using absolute paths on linux systems is broken: osgviewer
>> myfile.wrl works osgviewer /home/fkellner/myfile.wrl file not found.
>
> Falko, your patch seems to be right, because, indeed, we are loading
> files now, not URIs as before. However, then the Windows code path has
> to be changed to - the same problem will occur on Windows. The reason
> for the #ifdef is because on Windows the absolute path starts with
> colon, not slash (after removal of the drive letter).

It does look to me like this whole block can now be removed i.e.

    // convert possible Windows backslashes to Unix slashes
    // OpenVRML doesn't like backslashes, even on Windows
    std::string unixFileName = osgDB::convertFileNameToUnixStyle(fileName);

#ifdef WIN32
    if(unixFileName[1] == ':') // absolute path
    fileName = "file:///" + unixFileName;
#else
    if (unixFileName[0] == '/') // absolute path
        fileName = "file://" + unixFileName;
#endif
    else
        // relative path
        fileName = unixFileName;


Should be replaced with:

      fileName = osgDB::convertFileNameToUnixStyle(fileName);


I do wonder if the this conversion to unix style / could be replaced
as well, and just fileName used directly as we are now opening our own
streams.

Does the new OpenVRML based code use any of OpenVRML for file loading?

Thoughts?

Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to