mirror of
https://github.com/opensim/opensim.git
synced 2026-06-25 15:55:46 +08:00
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
This commit is contained in:
@@ -285,24 +285,22 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
|
||||
return;
|
||||
}
|
||||
|
||||
byte[] assetData;
|
||||
byte[] assetData = null;
|
||||
AssetBase oldAsset = null;
|
||||
|
||||
if (BlendWithOldTexture)
|
||||
{
|
||||
UUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID;
|
||||
oldAsset = scene.AssetService.Get(lastTextureID.ToString());
|
||||
if (oldAsset != null)
|
||||
Primitive.TextureEntryFace defaultFace = part.Shape.Textures.DefaultTexture;
|
||||
if (defaultFace != null)
|
||||
{
|
||||
assetData = BlendTextures(data, oldAsset.Data, SetNewFrontAlpha, FrontAlpha);
|
||||
}
|
||||
else
|
||||
{
|
||||
assetData = new byte[data.Length];
|
||||
Array.Copy(data, assetData, data.Length);
|
||||
oldAsset = scene.AssetService.Get(defaultFace.TextureID.ToString());
|
||||
|
||||
if (oldAsset != null)
|
||||
assetData = BlendTextures(data, oldAsset.Data, SetNewFrontAlpha, FrontAlpha);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (assetData == null)
|
||||
{
|
||||
assetData = new byte[data.Length];
|
||||
Array.Copy(data, assetData, data.Length);
|
||||
|
||||
Reference in New Issue
Block a user