aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs75
-rw-r--r--OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs8
5 files changed, 59 insertions, 42 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
index 2d9143a..a547df5 100644
--- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
@@ -46,6 +46,9 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
46 46
47 private const int ALL_SIDES = -1; 47 private const int ALL_SIDES = -1;
48 48
49 public const int DISP_EXPIRE = 1;
50 public const int DISP_TEMP = 2;
51
49 private Dictionary<UUID, Scene> RegisteredScenes = new Dictionary<UUID, Scene>(); 52 private Dictionary<UUID, Scene> RegisteredScenes = new Dictionary<UUID, Scene>();
50 53
51 private Dictionary<string, IDynamicTextureRender> RenderPlugins = 54 private Dictionary<string, IDynamicTextureRender> RenderPlugins =
@@ -110,15 +113,17 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
110 public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, 113 public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url,
111 string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) 114 string extraParams, int updateTimer, bool SetBlending, byte AlphaValue)
112 { 115 {
113 return AddDynamicTextureURL(simID, primID, contentType, url, extraParams, updateTimer, SetBlending, AlphaValue, ALL_SIDES); 116 return AddDynamicTextureURL(simID, primID, contentType, url,
117 extraParams, updateTimer, SetBlending,
118 (int)(DISP_TEMP|DISP_EXPIRE), AlphaValue, ALL_SIDES);
114 } 119 }
115 120
116 public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, 121 public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url,
117 string extraParams, int updateTimer, bool SetBlending, byte AlphaValue, int face) 122 string extraParams, int updateTimer, bool SetBlending,
123 int disp, byte AlphaValue, int face)
118 { 124 {
119 if (RenderPlugins.ContainsKey(contentType)) 125 if (RenderPlugins.ContainsKey(contentType))
120 { 126 {
121 //m_log.Debug("dynamic texture being created: " + url + " of type " + contentType);
122 127
123 DynamicTextureUpdater updater = new DynamicTextureUpdater(); 128 DynamicTextureUpdater updater = new DynamicTextureUpdater();
124 updater.SimUUID = simID; 129 updater.SimUUID = simID;
@@ -131,6 +136,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
131 updater.BlendWithOldTexture = SetBlending; 136 updater.BlendWithOldTexture = SetBlending;
132 updater.FrontAlpha = AlphaValue; 137 updater.FrontAlpha = AlphaValue;
133 updater.Face = face; 138 updater.Face = face;
139 updater.Disp = disp;
134 140
135 lock (Updaters) 141 lock (Updaters)
136 { 142 {
@@ -155,11 +161,12 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
155 public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, 161 public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data,
156 string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) 162 string extraParams, int updateTimer, bool SetBlending, byte AlphaValue)
157 { 163 {
158 return AddDynamicTextureData(simID, primID, contentType, data, extraParams, updateTimer, SetBlending, AlphaValue, ALL_SIDES); 164 return AddDynamicTextureData(simID, primID, contentType, data, extraParams, updateTimer, SetBlending,
165 (int) (DISP_TEMP|DISP_EXPIRE), AlphaValue, ALL_SIDES);
159 } 166 }
160 167
161 public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, 168 public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data,
162 string extraParams, int updateTimer, bool SetBlending, byte AlphaValue, int face) 169 string extraParams, int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face)
163 { 170 {
164 if (RenderPlugins.ContainsKey(contentType)) 171 if (RenderPlugins.ContainsKey(contentType))
165 { 172 {
@@ -175,6 +182,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
175 updater.FrontAlpha = AlphaValue; 182 updater.FrontAlpha = AlphaValue;
176 updater.Face = face; 183 updater.Face = face;
177 updater.Url = "Local image"; 184 updater.Url = "Local image";
185 updater.Disp = disp;
178 186
179 lock (Updaters) 187 lock (Updaters)
180 { 188 {
@@ -252,6 +260,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
252 public UUID UpdaterID; 260 public UUID UpdaterID;
253 public int UpdateTimer; 261 public int UpdateTimer;
254 public int Face; 262 public int Face;
263 public int Disp;
255 public string Url; 264 public string Url;
256 265
257 public DynamicTextureUpdater() 266 public DynamicTextureUpdater()
@@ -269,7 +278,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
269 278
270 SceneObjectPart part = scene.GetSceneObjectPart(PrimID); 279 SceneObjectPart part = scene.GetSceneObjectPart(PrimID);
271 280
272 if (data == null || data.Length <= 1) 281 if (part == null || data == null || data.Length <= 1)
273 { 282 {
274 string msg = 283 string msg =
275 String.Format("DynamicTextureModule: Error preparing image using URL {0}", Url); 284 String.Format("DynamicTextureModule: Error preparing image using URL {0}", Url);
@@ -309,8 +318,9 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
309 asset.Type = 0; 318 asset.Type = 0;
310 asset.Description = String.Format("URL image : {0}", Url); 319 asset.Description = String.Format("URL image : {0}", Url);
311 asset.Local = false; 320 asset.Local = false;
312 asset.Temporary = true; 321 asset.Temporary = ((Disp & DISP_TEMP) != 0);
313 scene.AssetService.Store(asset); 322 scene.AssetService.Store(asset);
323// scene.CommsManager.AssetCache.AddAsset(asset);
314 324
315 IJ2KDecoder cacheLayerDecode = scene.RequestModuleInterface<IJ2KDecoder>(); 325 IJ2KDecoder cacheLayerDecode = scene.RequestModuleInterface<IJ2KDecoder>();
316 if (cacheLayerDecode != null) 326 if (cacheLayerDecode != null)
@@ -320,37 +330,42 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
320 LastAssetID = asset.FullID; 330 LastAssetID = asset.FullID;
321 } 331 }
322 332
323 // mostly keep the values from before 333 UUID oldID = UUID.Zero;
324 Primitive.TextureEntry tmptex = part.Shape.Textures;
325 334
326 // remove the old asset from the cache later 335 lock(part)
327 UUID oldID = tmptex.DefaultTexture.TextureID;
328
329 if (Face == ALL_SIDES)
330 {
331 tmptex.DefaultTexture.TextureID = asset.FullID;
332 }
333 else
334 { 336 {
335 try 337 // mostly keep the values from before
338 Primitive.TextureEntry tmptex = part.Shape.Textures;
339
340 // remove the old asset from the cache
341 oldID = tmptex.DefaultTexture.TextureID;
342
343 if(Face == ALL_SIDES)
336 { 344 {
337 Primitive.TextureEntryFace texface = tmptex.CreateFace((uint)Face); 345 tmptex.DefaultTexture.TextureID = asset.FullID;
338 texface.TextureID = asset.FullID;
339 tmptex.FaceTextures[Face] = texface;
340 } 346 }
341 catch(Exception) 347 else
342 { 348 {
343 tmptex.DefaultTexture.TextureID = asset.FullID; 349 try
350 {
351 Primitive.TextureEntryFace texface = tmptex.CreateFace((uint)Face);
352 texface.TextureID = asset.FullID;
353 tmptex.FaceTextures[Face] = texface;
354 }
355 catch(Exception e)
356 {
357 tmptex.DefaultTexture.TextureID = asset.FullID;
358 }
344 } 359 }
345 }
346 360
347 // I'm pretty sure we always want to force this to true 361 // I'm pretty sure we always want to force this to true
348 // I'm pretty sure noone whats to set fullbright true if it wasn't true before. 362 // I'm pretty sure noone whats to set fullbright true if it wasn't true before.
349 // tmptex.DefaultTexture.Fullbright = true; 363 // tmptex.DefaultTexture.Fullbright = true;
350 364
351 part.UpdateTexture(tmptex); 365 part.UpdateTexture(tmptex);
352 366 }
353 if (Face == ALL_SIDES) 367
368 if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0))
354 { 369 {
355 // scene.CommsManager.AssetCache.ExpireAsset(oldID); 370 // scene.CommsManager.AssetCache.ExpireAsset(oldID);
356 scene.AssetService.Delete(oldID.ToString()); 371 scene.AssetService.Delete(oldID.ToString());
diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs
index f82b322..95f9cef 100644
--- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs
+++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs
@@ -30,8 +30,10 @@ using OpenMetaverse;
30 30
31namespace OpenSim.Region.Framework.Interfaces 31namespace OpenSim.Region.Framework.Interfaces
32{ 32{
33
33 public interface IDynamicTextureManager 34 public interface IDynamicTextureManager
34 { 35 {
36
35 void RegisterRender(string handleType, IDynamicTextureRender render); 37 void RegisterRender(string handleType, IDynamicTextureRender render);
36 void ReturnData(UUID id, byte[] data); 38 void ReturnData(UUID id, byte[] data);
37 39
@@ -40,13 +42,13 @@ namespace OpenSim.Region.Framework.Interfaces
40 UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, 42 UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams,
41 int updateTimer, bool SetBlending, byte AlphaValue); 43 int updateTimer, bool SetBlending, byte AlphaValue);
42 UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, 44 UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams,
43 int updateTimer, bool SetBlending, byte AlphaValue, int face); 45 int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face);
44 UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, 46 UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams,
45 int updateTimer); 47 int updateTimer);
46 UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, 48 UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams,
47 int updateTimer, bool SetBlending, byte AlphaValue); 49 int updateTimer, bool SetBlending, byte AlphaValue);
48 UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, 50 UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams,
49 int updateTimer, bool SetBlending, byte AlphaValue, int face); 51 int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face);
50 void GetDrawStringSize(string contentType, string text, string fontName, int fontSize, 52 void GetDrawStringSize(string contentType, string text, string fontName, int fontSize,
51 out double xSize, out double ySize); 53 out double xSize, out double ySize);
52 } 54 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 9b65d8d..7f3db9c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -428,7 +428,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
428 } 428 }
429 429
430 public string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams, 430 public string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams,
431 bool blend, int timer, int alpha, int face) 431 bool blend, int disp, int timer, int alpha, int face)
432 { 432 {
433 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURLBlendFace"); 433 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURLBlendFace");
434 434
@@ -438,7 +438,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
438 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 438 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
439 UUID createdTexture = 439 UUID createdTexture =
440 textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, 440 textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url,
441 extraParams, timer, blend, (byte) alpha, face); 441 extraParams, timer, blend, disp, (byte) alpha, face);
442 return createdTexture.ToString(); 442 return createdTexture.ToString();
443 } 443 }
444 else 444 else
@@ -508,7 +508,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
508 } 508 }
509 509
510 public string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, 510 public string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams,
511 bool blend, int timer, int alpha, int face) 511 bool blend, int disp, int timer, int alpha, int face)
512 { 512 {
513 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureDataBlendFace"); 513 CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureDataBlendFace");
514 514
@@ -524,7 +524,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
524 } 524 }
525 UUID createdTexture = 525 UUID createdTexture =
526 textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, 526 textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data,
527 extraParams, timer, blend, (byte) alpha, face); 527 extraParams, timer, blend, disp, (byte) alpha, face);
528 return createdTexture.ToString(); 528 return createdTexture.ToString();
529 } 529 }
530 } 530 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index e337c6b..debbad6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -59,12 +59,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
59 string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, 59 string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams,
60 int timer, int alpha); 60 int timer, int alpha);
61 string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams, 61 string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams,
62 bool blend, int timer, int alpha, int face); 62 bool blend, int disp, int timer, int alpha, int face);
63 string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, int timer); 63 string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, int timer);
64 string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, 64 string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams,
65 int timer, int alpha); 65 int timer, int alpha);
66 string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, 66 string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams,
67 bool blend, int timer, int alpha, int face); 67 bool blend, int disp, int timer, int alpha, int face);
68 68
69 LSL_Float osTerrainGetHeight(int x, int y); 69 LSL_Float osTerrainGetHeight(int x, int y);
70 LSL_Integer osTerrainSetHeight(int x, int y, double val); 70 LSL_Integer osTerrainSetHeight(int x, int y, double val);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 5df2d6e..193e2e0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -135,17 +135,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
135 } 135 }
136 136
137 public string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams, 137 public string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams,
138 bool blend, int timer, int alpha, int face) 138 bool blend, int disp, int timer, int alpha, int face)
139 { 139 {
140 return m_OSSL_Functions.osSetDynamicTextureURLBlendFace(dynamicID, contentType, url, extraParams, 140 return m_OSSL_Functions.osSetDynamicTextureURLBlendFace(dynamicID, contentType, url, extraParams,
141 blend, timer, alpha, face); 141 blend, disp, timer, alpha, face);
142 } 142 }
143 143
144 public string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, 144 public string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams,
145 bool blend, int timer, int alpha, int face) 145 bool blend, int disp, int timer, int alpha, int face)
146 { 146 {
147 return m_OSSL_Functions.osSetDynamicTextureDataBlendFace(dynamicID, contentType, data, extraParams, 147 return m_OSSL_Functions.osSetDynamicTextureDataBlendFace(dynamicID, contentType, data, extraParams,
148 blend, timer, alpha, face); 148 blend, disp, timer, alpha, face);
149 } 149 }
150 150
151 public LSL_Float osTerrainGetHeight(int x, int y) 151 public LSL_Float osTerrainGetHeight(int x, int y)