diff options
author | Dahlia Trimble | 2009-05-29 05:11:50 +0000 |
---|---|---|
committer | Dahlia Trimble | 2009-05-29 05:11:50 +0000 |
commit | 1609e7eac0562cb011c8d29fb17f6062226f5c3a (patch) | |
tree | f9dd6f15639411e78960724ad4fd49c479951c97 | |
parent | null test for texture assets when using cached sculpt map (diff) | |
download | opensim-SC-1609e7eac0562cb011c8d29fb17f6062226f5c3a.zip opensim-SC-1609e7eac0562cb011c8d29fb17f6062226f5c3a.tar.gz opensim-SC-1609e7eac0562cb011c8d29fb17f6062226f5c3a.tar.bz2 opensim-SC-1609e7eac0562cb011c8d29fb17f6062226f5c3a.tar.xz |
disable sculpt map caching until a better method of avoiding asset requests can be found
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 13 |
3 files changed, 15 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index a60ae83..37ab581 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2967,10 +2967,10 @@ 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 | // part.SculptTextureCallback(part.Shape.SculptTexture, null); |
2973 | else | 2973 | //else |
2974 | m_scene.AssetService.Get( | 2974 | m_scene.AssetService.Get( |
2975 | part.Shape.SculptTexture.ToString(), part, AssetReceived); | 2975 | part.Shape.SculptTexture.ToString(), part, AssetReceived); |
2976 | } | 2976 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index e71ce00..093dd73 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2268,8 +2268,10 @@ if (m_shape != null) { | |||
2268 | { | 2268 | { |
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 | ||
2272 | if (texture != null) | ||
2271 | { | 2273 | { |
2272 | if (texture != null) | 2274 | //if (texture != null) |
2273 | m_shape.SculptData = texture.Data; | 2275 | m_shape.SculptData = texture.Data; |
2274 | 2276 | ||
2275 | if (PhysActor != null) | 2277 | if (PhysActor != null) |
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 21f922f..6832507 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -71,6 +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 string decodedScultMapPath = "j2kDecodeCache"; | 75 | private string decodedScultMapPath = "j2kDecodeCache"; |
75 | 76 | ||
76 | 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 |
@@ -186,7 +187,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
186 | if (primShape.SculptData.Length == 0) | 187 | if (primShape.SculptData.Length == 0) |
187 | return null; | 188 | return null; |
188 | 189 | ||
189 | if (primShape.SculptTexture != null) | 190 | if (cacheSculptMaps && primShape.SculptTexture != null) |
190 | { | 191 | { |
191 | decodedSculptFileName = System.IO.Path.Combine(decodedScultMapPath, "smap_" + primShape.SculptTexture.ToString()); | 192 | decodedSculptFileName = System.IO.Path.Combine(decodedScultMapPath, "smap_" + primShape.SculptTexture.ToString()); |
192 | try | 193 | try |
@@ -199,7 +200,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
199 | catch (Exception e) | 200 | catch (Exception e) |
200 | { | 201 | { |
201 | m_log.Error("[SCULPT]: unable to load cached sculpt map " + decodedSculptFileName + " " + e.Message); | 202 | m_log.Error("[SCULPT]: unable to load cached sculpt map " + decodedSculptFileName + " " + e.Message); |
202 | 203 | ||
203 | } | 204 | } |
204 | if (idata != null) | 205 | if (idata != null) |
205 | m_log.Debug("[SCULPT]: loaded cached map asset for map ID: " + primShape.SculptTexture.ToString()); | 206 | m_log.Debug("[SCULPT]: loaded cached map asset for map ID: " + primShape.SculptTexture.ToString()); |
@@ -212,9 +213,11 @@ namespace OpenSim.Region.Physics.Meshing | |||
212 | ManagedImage managedImage; // we never use this | 213 | ManagedImage managedImage; // we never use this |
213 | OpenJPEG.DecodeToImage(primShape.SculptData, out managedImage, out idata); | 214 | OpenJPEG.DecodeToImage(primShape.SculptData, out managedImage, out idata); |
214 | 215 | ||
215 | //if (File.Exists(System.IO.Path.GetDirectoryName(decodedScultMapPath))) | 216 | if (cacheSculptMaps) |
216 | try { idata.Save(decodedSculptFileName, ImageFormat.MemoryBmp); } | 217 | { |
217 | catch (Exception e) { m_log.Error("[SCULPT]: unable to cache sculpt map " + decodedSculptFileName + " " + e.Message); } | 218 | try { idata.Save(decodedSculptFileName, ImageFormat.MemoryBmp); } |
219 | catch (Exception e) { m_log.Error("[SCULPT]: unable to cache sculpt map " + decodedSculptFileName + " " + e.Message); } | ||
220 | } | ||
218 | } | 221 | } |
219 | catch (DllNotFoundException) | 222 | catch (DllNotFoundException) |
220 | { | 223 | { |