attempt to expire out old dynamic textures, so they don't grow forever.

0.6.0-stable
Sean Dague 2008-06-30 18:27:01 +00:00
parent 721988adcd
commit 32ca6b6035
1 changed files with 7 additions and 2 deletions

View File

@ -229,7 +229,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
Array.Copy(data, assetData, data.Length);
}
//TODO delete the last asset(data), if it was a dynamic texture
// Create a new asset for user
AssetBase asset = new AssetBase();
asset.FullID = LLUUID.Random();
asset.Data = assetData;
@ -244,6 +244,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
// mostly keep the values from before
LLObject.TextureEntry tmptex = part.Shape.Textures;
// remove the old asset from the cache
LLUUID oldID = tmptex.DefaultTexture.TextureID;
scene.AssetCache.ExpireAsset(oldID);
tmptex.DefaultTexture.TextureID = asset.FullID;
// I'm pretty sure we always want to force this to true
tmptex.DefaultTexture.Fullbright = true;