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

View File

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

View File

@ -35,6 +35,7 @@ using System.Drawing;
using System.Drawing.Imaging;
using PrimMesher;
using log4net;
using Nini.Config;
using System.Reflection;
using System.IO;
@ -51,9 +52,9 @@ namespace OpenSim.Region.Physics.Meshing
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
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 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
{
if (!Directory.Exists(decodedScultMapPath))

View File

@ -48,6 +48,10 @@ namespace OpenSim.Region.Physics.OdePlugin
[SetUp]
public void Initialize()
{
IConfigSource TopConfig = new IniConfigSource();
IConfig config = TopConfig.AddConfig("Startup");
config.Set("DecodedSculpMapPath","j2kDecodeCache");
// Loading ODEPlugin
cbt = new OdePlugin();
// Loading Zero Mesher
@ -55,7 +59,7 @@ namespace OpenSim.Region.Physics.OdePlugin
// Getting Physics Scene
ps = cbt.GetScene("test");
// Initializing Physics Scene.
ps.Initialise(imp.GetMesher(),null);
ps.Initialise(imp.GetMesher(TopConfig),null);
float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize];
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
; prims
; DisableUndergroundMovement = true
<<<<<<< HEAD:bin/OpenSimDefaults.ini
; Path to script engine assemblies
; Default is ./bin/ScriptEngines
=======
;; Path to script assemblies
>>>>>>> 298b4c0... Some cleanup to OpenSimDefaults.ini:OpenSim/Region/Application/OpenSimDefaults.ini
; ScriptEnginesPath = "ScriptEngines"
[OpenGridProtocol]