From 3b689e506f82ea45fcf703b22eb50a00e40baa4f Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Fri, 22 May 2009 16:22:49 +0000 Subject: From: Alan Webb Changes to support client-side image pre-caching in the region. This commit adds an additional calling sequence to the DynamicTexture data and URL calls. The new interface allows a dynamic image to be loaded into a specific object face (rather than the mandatory ALL_SIDES supported today. This is in part fulfilment of ticket #458. --- .../Shared/Api/Implementation/OSSL_Api.cs | 51 ++++++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 4 ++ .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 14 ++++++ 3 files changed, 69 insertions(+) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index fbae9c8..91ee1b3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -427,6 +427,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return UUID.Zero.ToString(); } + public string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams, + bool blend, int timer, int alpha, int face) + { + CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureURLBlendFace"); + + m_host.AddScriptLPS(1); + if (dynamicID == String.Empty) + { + IDynamicTextureManager textureManager = World.RequestModuleInterface(); + UUID createdTexture = + textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, + extraParams, timer, blend, (byte) alpha, face); + return createdTexture.ToString(); + } + else + { + //TODO update existing dynamic textures + } + + return UUID.Zero.ToString(); + } + public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, int timer) { @@ -485,6 +507,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return UUID.Zero.ToString(); } + public string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, + bool blend, int timer, int alpha, int face) + { + CheckThreatLevel(ThreatLevel.VeryLow, "osSetDynamicTextureDataBlendFace"); + + m_host.AddScriptLPS(1); + if (dynamicID == String.Empty) + { + IDynamicTextureManager textureManager = World.RequestModuleInterface(); + if (textureManager != null) + { + if (extraParams == String.Empty) + { + extraParams = "256"; + } + UUID createdTexture = + textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, + extraParams, timer, blend, (byte) alpha, face); + return createdTexture.ToString(); + } + } + else + { + //TODO update existing dynamic textures + } + + return UUID.Zero.ToString(); + } + public bool osConsoleCommand(string command) { CheckThreatLevel(ThreatLevel.Severe, "osConsoleCommand"); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 7c0f086..3360abe 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -58,9 +58,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer); string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, int timer, int alpha); + string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams, + bool blend, int timer, int alpha, int face); string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, int timer); string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, int timer, int alpha); + string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, + bool blend, int timer, int alpha, int face); LSL_Float osTerrainGetHeight(int x, int y); 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 a66ed30..9d8920f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -134,6 +134,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osSetDynamicTextureDataBlend(dynamicID, contentType, data, extraParams, timer, alpha); } + public string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams, + bool blend, int timer, int alpha, int face) + { + return m_OSSL_Functions.osSetDynamicTextureURLBlendFace(dynamicID, contentType, url, extraParams, + blend, timer, alpha, face); + } + + public string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, + bool blend, int timer, int alpha, int face) + { + return m_OSSL_Functions.osSetDynamicTextureDataBlendFace(dynamicID, contentType, data, extraParams, + blend, timer, alpha, face); + } + public LSL_Float osTerrainGetHeight(int x, int y) { return m_OSSL_Functions.osTerrainGetHeight(x, y); -- cgit v1.1