From 65ecea4e4a2aca17688962c290651e7526ce1dcb Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 15 Aug 2007 15:11:48 +0000 Subject: [PATCH] From Jan Ciger, "I am attaching a little hack from Jean-Sebastien Guay which allows absolute paths to work on Windows." --- src/osgPlugins/vrml/ReaderWriterVRML2.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osgPlugins/vrml/ReaderWriterVRML2.cpp b/src/osgPlugins/vrml/ReaderWriterVRML2.cpp index a968fd559..0af7c63b1 100644 --- a/src/osgPlugins/vrml/ReaderWriterVRML2.cpp +++ b/src/osgPlugins/vrml/ReaderWriterVRML2.cpp @@ -80,10 +80,14 @@ osgDB::ReaderWriter::ReadResult ReaderWriterVRML2::readNode(const std::string &f // OpenVRML doesn't like backslashes, even on Windows std::string unixFileName = osgDB::convertFileNameToUnixStyle(fileName); +#ifdef WIN32 + fileName = "file://" + unixFileName; +#else if(unixFileName[0] == '/') // absolute path fileName = "file://" + unixFileName; else // relative path fileName = unixFileName; +#endif std::fstream null; openvrml::browser *browser = new openvrml::browser(null, null);