aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDahlia Trimble2009-05-29 06:50:15 +0000
committerDahlia Trimble2009-05-29 06:50:15 +0000
commit05cbf0b502f65ebae5330e4db27fc8cf85a83b48 (patch)
treea7b29b279bf79497623f7fab82fea9fc695475f2
parentplumbing for future sculpt map caching (diff)
downloadopensim-SC_OLD-05cbf0b502f65ebae5330e4db27fc8cf85a83b48.zip
opensim-SC_OLD-05cbf0b502f65ebae5330e4db27fc8cf85a83b48.tar.gz
opensim-SC_OLD-05cbf0b502f65ebae5330e4db27fc8cf85a83b48.tar.bz2
opensim-SC_OLD-05cbf0b502f65ebae5330e4db27fc8cf85a83b48.tar.xz
reinstate a hopefully more robust experimental decoded sculpt map caching scheme
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs4
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs8
3 files changed, 18 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 37ab581..4446fa4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2967,10 +2967,13 @@ namespace OpenSim.Region.Framework.Scenes
2967 { 2967 {
2968 if (part.Shape.SculptEntry && part.Shape.SculptTexture != UUID.Zero) 2968 if (part.Shape.SculptEntry && part.Shape.SculptTexture != UUID.Zero)
2969 { 2969 {
2970 //// check if a previously decoded sculpt map has been cached 2970 // check if a previously decoded sculpt map has been cached
2971 //if (File.Exists(System.IO.Path.Combine("j2kDecodeCache", "smap_" + part.Shape.SculptTexture.ToString()))) 2971 if (File.Exists(System.IO.Path.Combine("j2kDecodeCache", "smap_" + part.Shape.SculptTexture.ToString())))
2972 // part.SculptTextureCallback(part.Shape.SculptTexture, null); 2972 {
2973 //else 2973 m_log.Debug("[SCULPT]: found cached sculpt map - calling AssetReceived");
2974 part.SculptTextureCallback(part.Shape.SculptTexture, null);
2975 }
2976 else
2974 m_scene.AssetService.Get( 2977 m_scene.AssetService.Get(
2975 part.Shape.SculptTexture.ToString(), part, AssetReceived); 2978 part.Shape.SculptTexture.ToString(), part, AssetReceived);
2976 } 2979 }
@@ -2982,10 +2985,11 @@ namespace OpenSim.Region.Framework.Scenes
2982 2985
2983 protected void AssetReceived(string id, Object sender, AssetBase asset) 2986 protected void AssetReceived(string id, Object sender, AssetBase asset)
2984 { 2987 {
2985 if (asset != null) 2988 SceneObjectPart sop = (SceneObjectPart)sender;
2989
2990 if (sop != null)
2986 { 2991 {
2987 SceneObjectPart sop = (SceneObjectPart)sender; 2992 if (asset != null)
2988 if (sop != null)
2989 sop.SculptTextureCallback(asset.FullID, asset); 2993 sop.SculptTextureCallback(asset.FullID, asset);
2990 } 2994 }
2991 } 2995 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 093dd73..71d4d33 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2269,9 +2269,9 @@ if (m_shape != null) {
2269 if (m_shape.SculptEntry) 2269 if (m_shape.SculptEntry)
2270 { 2270 {
2271 // commented out for sculpt map caching test - null could mean a cached sculpt map has been found 2271 // commented out for sculpt map caching test - null could mean a cached sculpt map has been found
2272 if (texture != null) 2272 //if (texture != null)
2273 { 2273 {
2274 //if (texture != null) 2274 if (texture != null)
2275 m_shape.SculptData = texture.Data; 2275 m_shape.SculptData = texture.Data;
2276 2276
2277 if (PhysActor != null) 2277 if (PhysActor != null)
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 6832507..f3e79c9 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -71,7 +71,7 @@ namespace OpenSim.Region.Physics.Meshing
71 private const string baseDir = null; //"rawFiles"; 71 private const string baseDir = null; //"rawFiles";
72#endif 72#endif
73 73
74 private bool cacheSculptMaps = false; 74 private bool cacheSculptMaps = true;
75 private string decodedScultMapPath = "j2kDecodeCache"; 75 private string decodedScultMapPath = "j2kDecodeCache";
76 76
77 private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh 77 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
184 184
185 if (primShape.SculptEntry) 185 if (primShape.SculptEntry)
186 { 186 {
187 if (primShape.SculptData.Length == 0) 187 //if (primShape.SculptData.Length == 0)
188 return null; 188 // return null;
189 189
190 if (cacheSculptMaps && primShape.SculptTexture != null) 190 if (cacheSculptMaps && primShape.SculptTexture != null)
191 { 191 {
@@ -196,6 +196,8 @@ namespace OpenSim.Region.Physics.Meshing
196 { 196 {
197 idata = Image.FromFile(decodedSculptFileName); 197 idata = Image.FromFile(decodedSculptFileName);
198 } 198 }
199 else if (primShape.SculptData.Length == 0)
200 return null;
199 } 201 }
200 catch (Exception e) 202 catch (Exception e)
201 { 203 {