aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-02-18 00:33:52 +0000
committerJustin Clark-Casey (justincc)2012-02-18 00:33:52 +0000
commitb817c337dc2c5d8efda710f445114aa9a9344611 (patch)
tree4ff5ef565c57495fa89e051504983117413d8cee /OpenSim/Region/Physics/OdePlugin
parentFillin missing SQLite support for Telehubs (diff)
downloadopensim-SC_OLD-b817c337dc2c5d8efda710f445114aa9a9344611.zip
opensim-SC_OLD-b817c337dc2c5d8efda710f445114aa9a9344611.tar.gz
opensim-SC_OLD-b817c337dc2c5d8efda710f445114aa9a9344611.tar.bz2
opensim-SC_OLD-b817c337dc2c5d8efda710f445114aa9a9344611.tar.xz
On Windows automatically load the correct native ODE library depending on whether the process is 32-bit or 64-bit
In theory, this means that a 64-bit Windows OS user can now run OpenSim.exe with ODE and use more than 2 (or 3) GB of memory. However, this is completely untested since I don't currently own a 64-bit Windows box. Feedback appreciated. Using OpenSim.32BitLaunch.exe should continue to work. Other platforms are unaffected. This will currently not work with sqlite - I will add that too if this works.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs24
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 716161a..6ee2714 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Physics.OdePlugin
46 /// </summary> 46 /// </summary>
47 public class OdePlugin : IPhysicsPlugin 47 public class OdePlugin : IPhysicsPlugin
48 { 48 {
49 //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
50 50
51 private OdeScene m_scene; 51 private OdeScene m_scene;
52 52
@@ -59,13 +59,33 @@ namespace OpenSim.Region.Physics.OdePlugin
59 { 59 {
60 if (m_scene == null) 60 if (m_scene == null)
61 { 61 {
62 // We do this so that OpenSimulator on Windows loads the correct native ODE library depending on whether
63 // it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports
64 // will find it already loaded later on.
65 //
66 // This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
67 // controlled in Ode.NET.dll.config
68 if (Util.IsWindows())
69 {
70 string nativeLibraryPath;
71
72 if (Util.Is64BitProcess())
73 nativeLibraryPath = "lib64/ode.dll";
74 else
75 nativeLibraryPath = "lib32/ode.dll";
76
77 m_log.DebugFormat("[ODE PLUGIN]: Loading native Windows ODE library at {0}", nativeLibraryPath);
78 Util.LoadLibrary(nativeLibraryPath);
79 }
80
62 // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to 81 // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to
63 // http://opensimulator.org/mantis/view.php?id=2750). 82 // http://opensimulator.org/mantis/view.php?id=2750).
64 d.InitODE(); 83 d.InitODE();
65 84
66 m_scene = new OdeScene(sceneIdentifier); 85 m_scene = new OdeScene(sceneIdentifier);
67 } 86 }
68 return (m_scene); 87
88 return m_scene;
69 } 89 }
70 90
71 public string GetName() 91 public string GetName()