From d340820826635069813e088f6c17266fbeadd393 Mon Sep 17 00:00:00 2001 From: MW Date: Sat, 8 Mar 2008 20:54:34 +0000 Subject: Added Frist basic version on the VectorRenderModule, that allows scripts to do some basic drawing onto textures. Currently the method the scripts have to use is most likely not the most user friendly, but this should improve soon. And hope to allow SVG files (either loaded from a web site, or even script created) to be used. I will add a page to the wiki tomorrow, until then http://www.pastebin.ca/934425 is a example c# script that can be used to get a bit of a idea. Also added osSetDynamicTextureDataBlend and osSetDynamicTextureURLBlend that will allow the various textures to be blended together, but currently there are still a few bugs in them. So not ready for use yet. --- .../Common/BuiltIn_Commands_BaseClass.cs | 18 ++++++ .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 66 ++++++++++++++++++++++ .../Common/LSL_BuiltIn_Commands_Interface.cs | 5 ++ 3 files changed, 89 insertions(+) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs index 922b301..79a106b 100644 --- a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs @@ -1849,6 +1849,24 @@ namespace OpenSim.Region.ScriptEngine.Common return m_LSL_Functions.osSetDynamicTextureURL(dynamicID, contentType, url, extraParams, timer); } + public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, + int timer) + { + return m_LSL_Functions.osSetDynamicTextureData(dynamicID, contentType, data, extraParams, timer); + } + + public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, + int timer, int alpha) + { + return m_LSL_Functions.osSetDynamicTextureURLBlend(dynamicID, contentType, url, extraParams, timer, alpha); + } + + public string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, + int timer, int alpha) + { + return m_LSL_Functions.osSetDynamicTextureDataBlend(dynamicID, contentType, data, extraParams, timer, alpha); + } + public double osTerrainGetHeight(int x, int y) { return m_LSL_Functions.osTerrainGetHeight(x, y); diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 7da47d4..93de3b4 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -4265,6 +4265,72 @@ namespace OpenSim.Region.ScriptEngine.Common return LLUUID.Zero.ToString(); } + public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, + int timer, int alpha) + { + m_host.AddScriptLPS(1); + if (dynamicID == String.Empty) + { + IDynamicTextureManager textureManager = World.RequestModuleInterface(); + LLUUID createdTexture = + textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, + extraParams, timer, true, (byte) alpha ); + return createdTexture.ToString(); + } + else + { + //TODO update existing dynamic textures + } + + return LLUUID.Zero.ToString(); + } + + public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, + int timer) + { + m_host.AddScriptLPS(1); + if (dynamicID == String.Empty) + { + IDynamicTextureManager textureManager = World.RequestModuleInterface(); + if (textureManager != null) + { + LLUUID createdTexture = + textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, + extraParams, timer); + return createdTexture.ToString(); + } + } + else + { + //TODO update existing dynamic textures + } + + return LLUUID.Zero.ToString(); + } + + public string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, + int timer, int alpha) + { + m_host.AddScriptLPS(1); + if (dynamicID == String.Empty) + { + IDynamicTextureManager textureManager = World.RequestModuleInterface(); + if (textureManager != null) + { + LLUUID createdTexture = + textureManager.AddDynamicTextureData(World.RegionInfo.RegionID, m_host.UUID, contentType, data, + extraParams, timer, true, (byte) alpha); + return createdTexture.ToString(); + } + } + else + { + //TODO update existing dynamic textures + } + + return LLUUID.Zero.ToString(); + } + public bool osConsoleCommand(string command) { m_host.AddScriptLPS(1); diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs index c1e178b..c6d683c 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs @@ -637,6 +637,11 @@ namespace OpenSim.Region.ScriptEngine.Common string llStringTrim(string src, int type); //OpenSim functions 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 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); double osTerrainGetHeight(int x, int y); int osTerrainSetHeight(int x, int y, double val); int osRegionRestart(double seconds); -- cgit v1.1