[Orxonox-commit 5635] r10295 - code/trunk/src/libraries/core

muemart at orxonox.net muemart at orxonox.net
Sun Mar 1 21:59:53 CET 2015


Author: muemart
Date: 2015-03-01 21:59:53 +0100 (Sun, 01 Mar 2015)
New Revision: 10295

Modified:
   code/trunk/src/libraries/core/DynLib.cc
   code/trunk/src/libraries/core/GraphicsManager.cc
   code/trunk/src/libraries/core/PathConfig.cc
Log:
Avoid using the system path variables on windows (also gets rid of two MSVC warnings)
The altered search path already includes the dll's directory, but it didn't work with forward slashes

Modified: code/trunk/src/libraries/core/DynLib.cc
===================================================================
--- code/trunk/src/libraries/core/DynLib.cc	2015-03-01 20:59:28 UTC (rev 10294)
+++ code/trunk/src/libraries/core/DynLib.cc	2015-03-01 20:59:53 UTC (rev 10295)
@@ -55,6 +55,10 @@
     DynLib::DynLib( const std::string& name )
     {
         mName = name;
+#if defined(ORXONOX_PLATFORM_WINDOWS)
+        //altered search path doesn't work with paths with forward slashes
+        std::replace(mName.begin(), mName.end(), '/', '\\');
+#endif
         m_hInst = NULL;
     }
 

Modified: code/trunk/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/trunk/src/libraries/core/GraphicsManager.cc	2015-03-01 20:59:28 UTC (rev 10294)
+++ code/trunk/src/libraries/core/GraphicsManager.cc	2015-03-01 20:59:53 UTC (rev 10295)
@@ -268,16 +268,6 @@
         }
 #endif
 
-#ifdef ORXONOX_PLATFORM_WINDOWS
-        // Add OGRE plugin path to the environment. That way one plugin could
-        // also depend on another without problems on Windows
-        const char* currentPATH = getenv("PATH");
-        std::string newPATH = pluginPath;
-        if (currentPATH != NULL)
-            newPATH = std::string(currentPATH) + ';' + newPATH;
-        putenv(const_cast<char*>(("PATH=" + newPATH).c_str()));
-#endif
-
         // Do some SubString magic to get the comma separated list of plugins
         SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '{', '}', false, '\0');
         for (unsigned int i = 0; i < plugins.size(); ++i)

Modified: code/trunk/src/libraries/core/PathConfig.cc
===================================================================
--- code/trunk/src/libraries/core/PathConfig.cc	2015-03-01 20:59:28 UTC (rev 10294)
+++ code/trunk/src/libraries/core/PathConfig.cc	2015-03-01 20:59:53 UTC (rev 10295)
@@ -259,15 +259,6 @@
         const std::string& moduleextension = specialConfig::moduleExtension;
         size_t moduleextensionlength = moduleextension.size();
 
-#ifdef ORXONOX_PLATFORM_WINDOWS
-        // Add that path to the PATH variable in case a module depends on another one
-        const char* currentPATH = getenv("PATH");
-        std::string newPATH = modulePath_.BF_NATIVE_STRING();
-        if (currentPATH != NULL)
-            newPATH = std::string(currentPATH) + ';' + newPATH;
-        putenv(const_cast<char*>(("PATH=" + newPATH).c_str()));
-#endif
-
         // Make sure the path exists, otherwise don't load modules
         if (!boost::filesystem::exists(modulePath_))
             return modulePaths;




More information about the Orxonox-commit mailing list