diff options
author | John Hurliman | 2010-03-16 11:50:22 -0700 |
---|---|---|
committer | John Hurliman | 2010-03-16 11:50:22 -0700 |
commit | b4dcdffb5094c488a98acbe675b333c3bd4cc570 (patch) | |
tree | 14998b10e4d13d2dd933a5d5e014db1f4bb07b43 /OpenSim/Region/CoreModules | |
parent | * Fixing the SimianGrid friend connector enabled detection since the friends ... (diff) | |
download | opensim-SC-b4dcdffb5094c488a98acbe675b333c3bd4cc570.zip opensim-SC-b4dcdffb5094c488a98acbe675b333c3bd4cc570.tar.gz opensim-SC-b4dcdffb5094c488a98acbe675b333c3bd4cc570.tar.bz2 opensim-SC-b4dcdffb5094c488a98acbe675b333c3bd4cc570.tar.xz |
Fixed several unhandled exceptions and performance issues with PrimitiveBaseShape.Textures. This really should be moved from a property to a method if it is going to decode a byte[] into a TextureEntry each time
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs | 7 |
2 files changed, 12 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 643764f..678e772 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -285,24 +285,22 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
285 | return; | 285 | return; |
286 | } | 286 | } |
287 | 287 | ||
288 | byte[] assetData; | 288 | byte[] assetData = null; |
289 | AssetBase oldAsset = null; | 289 | AssetBase oldAsset = null; |
290 | 290 | ||
291 | if (BlendWithOldTexture) | 291 | if (BlendWithOldTexture) |
292 | { | 292 | { |
293 | UUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; | 293 | Primitive.TextureEntryFace defaultFace = part.Shape.Textures.DefaultTexture; |
294 | oldAsset = scene.AssetService.Get(lastTextureID.ToString()); | 294 | if (defaultFace != null) |
295 | if (oldAsset != null) | ||
296 | { | ||
297 | assetData = BlendTextures(data, oldAsset.Data, SetNewFrontAlpha, FrontAlpha); | ||
298 | } | ||
299 | else | ||
300 | { | 295 | { |
301 | assetData = new byte[data.Length]; | 296 | oldAsset = scene.AssetService.Get(defaultFace.TextureID.ToString()); |
302 | Array.Copy(data, assetData, data.Length); | 297 | |
298 | if (oldAsset != null) | ||
299 | assetData = BlendTextures(data, oldAsset.Data, SetNewFrontAlpha, FrontAlpha); | ||
303 | } | 300 | } |
304 | } | 301 | } |
305 | else | 302 | |
303 | if (assetData == null) | ||
306 | { | 304 | { |
307 | assetData = new byte[data.Length]; | 305 | assetData = new byte[data.Length]; |
308 | Array.Copy(data, assetData, data.Length); | 306 | Array.Copy(data, assetData, data.Length); |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs index 285d36a..b71b5f6 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs | |||
@@ -251,13 +251,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
251 | // if you want tree blocks on the map comment the above line and uncomment the below line | 251 | // if you want tree blocks on the map comment the above line and uncomment the below line |
252 | //mapdotspot = Color.PaleGreen; | 252 | //mapdotspot = Color.PaleGreen; |
253 | 253 | ||
254 | if (part.Shape.Textures == null) | 254 | Primitive.TextureEntry textureEntry = part.Shape.Textures; |
255 | continue; | ||
256 | 255 | ||
257 | if (part.Shape.Textures.DefaultTexture == null) | 256 | if (textureEntry == null || textureEntry.DefaultTexture == null) |
258 | continue; | 257 | continue; |
259 | 258 | ||
260 | Color4 texcolor = part.Shape.Textures.DefaultTexture.RGBA; | 259 | Color4 texcolor = textureEntry.DefaultTexture.RGBA; |
261 | 260 | ||
262 | // Not sure why some of these are null, oh well. | 261 | // Not sure why some of these are null, oh well. |
263 | 262 | ||