reinstate a hopefully more robust experimental decoded sculpt map caching scheme

0.6.6-post-fixes
Dahlia Trimble 2009-05-29 06:50:15 +00:00
parent 42fa7cf989
commit 05cbf0b502
3 changed files with 18 additions and 12 deletions

View File

@ -2967,10 +2967,13 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (part.Shape.SculptEntry && part.Shape.SculptTexture != UUID.Zero) if (part.Shape.SculptEntry && part.Shape.SculptTexture != UUID.Zero)
{ {
//// check if a previously decoded sculpt map has been cached // check if a previously decoded sculpt map has been cached
//if (File.Exists(System.IO.Path.Combine("j2kDecodeCache", "smap_" + part.Shape.SculptTexture.ToString()))) if (File.Exists(System.IO.Path.Combine("j2kDecodeCache", "smap_" + part.Shape.SculptTexture.ToString())))
// part.SculptTextureCallback(part.Shape.SculptTexture, null); {
//else m_log.Debug("[SCULPT]: found cached sculpt map - calling AssetReceived");
part.SculptTextureCallback(part.Shape.SculptTexture, null);
}
else
m_scene.AssetService.Get( m_scene.AssetService.Get(
part.Shape.SculptTexture.ToString(), part, AssetReceived); part.Shape.SculptTexture.ToString(), part, AssetReceived);
} }
@ -2982,10 +2985,11 @@ namespace OpenSim.Region.Framework.Scenes
protected void AssetReceived(string id, Object sender, AssetBase asset) protected void AssetReceived(string id, Object sender, AssetBase asset)
{ {
if (asset != null) SceneObjectPart sop = (SceneObjectPart)sender;
if (sop != null)
{ {
SceneObjectPart sop = (SceneObjectPart)sender; if (asset != null)
if (sop != null)
sop.SculptTextureCallback(asset.FullID, asset); sop.SculptTextureCallback(asset.FullID, asset);
} }
} }

View File

@ -2269,9 +2269,9 @@ if (m_shape != null) {
if (m_shape.SculptEntry) if (m_shape.SculptEntry)
{ {
// commented out for sculpt map caching test - null could mean a cached sculpt map has been found // commented out for sculpt map caching test - null could mean a cached sculpt map has been found
if (texture != null) //if (texture != null)
{ {
//if (texture != null) if (texture != null)
m_shape.SculptData = texture.Data; m_shape.SculptData = texture.Data;
if (PhysActor != null) if (PhysActor != null)

View File

@ -71,7 +71,7 @@ namespace OpenSim.Region.Physics.Meshing
private const string baseDir = null; //"rawFiles"; private const string baseDir = null; //"rawFiles";
#endif #endif
private bool cacheSculptMaps = false; private bool cacheSculptMaps = true;
private string decodedScultMapPath = "j2kDecodeCache"; private string decodedScultMapPath = "j2kDecodeCache";
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
@ -184,8 +184,8 @@ namespace OpenSim.Region.Physics.Meshing
if (primShape.SculptEntry) if (primShape.SculptEntry)
{ {
if (primShape.SculptData.Length == 0) //if (primShape.SculptData.Length == 0)
return null; // return null;
if (cacheSculptMaps && primShape.SculptTexture != null) if (cacheSculptMaps && primShape.SculptTexture != null)
{ {
@ -196,6 +196,8 @@ namespace OpenSim.Region.Physics.Meshing
{ {
idata = Image.FromFile(decodedSculptFileName); idata = Image.FromFile(decodedSculptFileName);
} }
else if (primShape.SculptData.Length == 0)
return null;
} }
catch (Exception e) catch (Exception e)
{ {