diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index b04ee074ef..5b1be6c4f9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1413,6 +1413,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return drawList; } + public string osSetPenColor(string drawList, LSL_Types.Vector3 color) + { + CheckThreatLevel(); + + return osSetPenColor(drawList, color, (LSL_Float)1.0); + } + + public string osSetPenColor(string drawList, LSL_Types.Vector3 color, LSL_Float alpha) + { + CheckThreatLevel() ; + + int argbA = (int) (Util.Clamp ((float)alpha, 0f, 1f) * 255f); + int argbR = (int) (Util.Clamp ((float)color.x, 0f, 1f) * 255f); + int argbG = (int) (Util.Clamp ((float)color.y, 0f, 1f) * 255f); + int argbB = (int) (Util.Clamp ((float)color.z, 0f, 1f) * 255f); + + StringBuilder hexColorBuilder = new StringBuilder(); + hexColorBuilder.Append(argbA.ToString("X2")); + hexColorBuilder.Append(argbR.ToString("X2")); + hexColorBuilder.Append(argbG.ToString("X2")); + hexColorBuilder.Append(argbB.ToString("X2")); + + return osSetPenColor(drawList, hexColorBuilder.ToString()); + } + // Deprecated public string osSetPenColour(string drawList, string colour) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 76edca2ca5..2c7caf1e84 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -243,6 +243,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osSetFontSize(string drawList, int fontSize); string osSetPenSize(string drawList, int penSize); string osSetPenColor(string drawList, string color); + string osSetPenColor(string drawList, LSL_Types.Vector3 color); + string osSetPenColor(string drawList, LSL_Types.Vector3 color, LSL_Float alpha); string osSetPenColour(string drawList, string colour); // Deprecated string osSetPenCap(string drawList, string direction, string type); string osDrawImage(string drawList, int width, int height, string imageUrl); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 09b34e87ef..c19b01803a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -515,6 +515,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osSetPenColor(drawList, color); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string osSetPenColor(string drawList, vector color) + { + return m_OSSL_Functions.osSetPenColor(drawList, color); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string osSetPenColor(string drawList, vector color, float alpha) + { + return m_OSSL_Functions.osSetPenColor(drawList, color, alpha); + } + // Deprecated [MethodImpl(MethodImplOptions.AggressiveInlining)] public string osSetPenColour(string drawList, string colour) diff --git a/bin/ScriptSyntax.xml b/bin/ScriptSyntax.xml index 16d12948ac..5684797a68 100644 --- a/bin/ScriptSyntax.xml +++ b/bin/ScriptSyntax.xml @@ -1,4 +1,4 @@ -57bbb7d8-30e5-4fef-1b11-f073f30740d0 +08743d8a-ea46-11ed-ac8d-406c8fbbb495 llsd-lsl-syntax-version2 controls @@ -8040,6 +8040,23 @@ drawListtypestring colortypestring + + osSetPenColor + + returnstring + arguments + drawListtypestring + colortypevector + + + osSetPenColor + + returnstring + arguments + drawListtypestring + colortypevector + alphatypefloat + osSetPenColour