adding configurable j2kDecodeCache path

allowing the decoded sculpt map cache path to be defined in
	the configuration files.

	Use DecodedSculpMapPath in the [Startup] section to set
	the path. The default is still ./bin/j2kDecodeCache
viewer-2-initial-appearance
BlueWall 2010-09-25 22:36:38 -04:00 committed by Melanie
parent 8afa21cef0
commit b0b4782a2b
5 changed files with 18 additions and 14 deletions

View File

@ -81,7 +81,7 @@ namespace OpenSim.Region.Physics.Manager
if (_MeshPlugins.ContainsKey(meshEngineName)) if (_MeshPlugins.ContainsKey(meshEngineName))
{ {
m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName); m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName);
meshEngine = _MeshPlugins[meshEngineName].GetMesher(); meshEngine = _MeshPlugins[meshEngineName].GetMesher(config);
} }
else else
{ {
@ -234,6 +234,6 @@ namespace OpenSim.Region.Physics.Manager
public interface IMeshingPlugin public interface IMeshingPlugin
{ {
string GetName(); string GetName();
IMesher GetMesher(); IMesher GetMesher(IConfigSource config);
} }
} }

View File

@ -28,6 +28,7 @@
using System; using System;
using OpenSim.Framework; using OpenSim.Framework;
using OpenMetaverse; using OpenMetaverse;
using Nini.Config;
/* /*
* This is the zero mesher. * This is the zero mesher.
@ -53,7 +54,7 @@ namespace OpenSim.Region.Physics.Manager
return "ZeroMesher"; return "ZeroMesher";
} }
public IMesher GetMesher() public IMesher GetMesher(IConfigSource config)
{ {
return new ZeroMesher(); return new ZeroMesher();
} }

View File

@ -35,6 +35,7 @@ using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using PrimMesher; using PrimMesher;
using log4net; using log4net;
using Nini.Config;
using System.Reflection; using System.Reflection;
using System.IO; using System.IO;
@ -51,9 +52,9 @@ namespace OpenSim.Region.Physics.Meshing
return "Meshmerizer"; return "Meshmerizer";
} }
public IMesher GetMesher() public IMesher GetMesher(IConfigSource config)
{ {
return new Meshmerizer(); return new Meshmerizer(config);
} }
} }
@ -70,14 +71,18 @@ namespace OpenSim.Region.Physics.Meshing
#endif #endif
private bool cacheSculptMaps = true; private bool cacheSculptMaps = true;
private string decodedScultMapPath = "j2kDecodeCache"; private string decodedScultMapPath = null;
private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh
private Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>(); private Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>();
public Meshmerizer() public Meshmerizer(IConfigSource config)
{ {
IConfig start_config = config.Configs["Startup"];
decodedScultMapPath = start_config.GetString("DecodedSculpMapPath","j2kDecodeCache");
try try
{ {
if (!Directory.Exists(decodedScultMapPath)) if (!Directory.Exists(decodedScultMapPath))

View File

@ -48,6 +48,10 @@ namespace OpenSim.Region.Physics.OdePlugin
[SetUp] [SetUp]
public void Initialize() public void Initialize()
{ {
IConfigSource TopConfig = new IniConfigSource();
IConfig config = TopConfig.AddConfig("Startup");
config.Set("DecodedSculpMapPath","j2kDecodeCache");
// Loading ODEPlugin // Loading ODEPlugin
cbt = new OdePlugin(); cbt = new OdePlugin();
// Loading Zero Mesher // Loading Zero Mesher
@ -55,7 +59,7 @@ namespace OpenSim.Region.Physics.OdePlugin
// Getting Physics Scene // Getting Physics Scene
ps = cbt.GetScene("test"); ps = cbt.GetScene("test");
// Initializing Physics Scene. // Initializing Physics Scene.
ps.Initialise(imp.GetMesher(),null); ps.Initialise(imp.GetMesher(TopConfig),null);
float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize]; float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize];
for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++) for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++)
{ {

View File

@ -1003,14 +1003,8 @@
; false to allow script controlled underground positioning of ; false to allow script controlled underground positioning of
; prims ; prims
; DisableUndergroundMovement = true ; DisableUndergroundMovement = true
<<<<<<< HEAD:bin/OpenSimDefaults.ini
; Path to script engine assemblies
; Default is ./bin/ScriptEngines
=======
;; Path to script assemblies ;; Path to script assemblies
>>>>>>> 298b4c0... Some cleanup to OpenSimDefaults.ini:OpenSim/Region/Application/OpenSimDefaults.ini
; ScriptEnginesPath = "ScriptEngines" ; ScriptEnginesPath = "ScriptEngines"
[OpenGridProtocol] [OpenGridProtocol]