From cb8975e56729c6fd077a69df3a7fa06cba285f82 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 24 Jun 2017 23:04:37 +0100 Subject: add string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y), string osDrawRotationTransform(string drawList, LSL_Float x) and string osDrawResetTransform(string drawList) helper functions for the new vector renderer comands. Removed ThreadLevel check of similar funtions that had it None, and actually only set strings --- .../Shared/Api/Implementation/OSSL_Api.cs | 58 ++++++++++++++++------ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 3 ++ .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 15 ++++++ 3 files changed, 60 insertions(+), 16 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 3a0884f..e93a7d7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1153,9 +1153,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } //Texture draw functions + + public string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y) + { + CheckThreatLevel(); + + m_host.AddScriptLPS(1); + drawList += "TransTransf " + x + "," + y + ";"; + return drawList; + } + + public string osDrawRotationTransform(string drawList, LSL_Float x) + { + CheckThreatLevel(); + m_host.AddScriptLPS(1); + drawList += "RotTransf " + x + ";"; + return drawList; + } + + public string osDrawResetTransform(string drawList) + { + CheckThreatLevel(); + m_host.AddScriptLPS(1); + drawList += "ResetTransf;"; + return drawList; + } + public string osMovePen(string drawList, int x, int y) { - CheckThreatLevel(ThreatLevel.None, "osMovePen"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "MoveTo " + x + "," + y + ";"; @@ -1164,7 +1190,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawLine(string drawList, int startX, int startY, int endX, int endY) { - CheckThreatLevel(ThreatLevel.None, "osDrawLine"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "MoveTo "+ startX+","+ startY +"; LineTo "+endX +","+endY +"; "; @@ -1173,7 +1199,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawLine(string drawList, int endX, int endY) { - CheckThreatLevel(ThreatLevel.None, "osDrawLine"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "LineTo " + endX + "," + endY + "; "; @@ -1191,7 +1217,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawEllipse(string drawList, int width, int height) { - CheckThreatLevel(ThreatLevel.None, "osDrawEllipse"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "Ellipse " + width + "," + height + "; "; @@ -1200,7 +1226,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawFilledEllipse(string drawList, int width, int height) { - CheckThreatLevel(ThreatLevel.None, "osDrawFilledEllipse"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "FillEllipse " + width + "," + height + "; "; @@ -1209,7 +1235,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawRectangle(string drawList, int width, int height) { - CheckThreatLevel(ThreatLevel.None, "osDrawRectangle"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "Rectangle " + width + "," + height + "; "; @@ -1218,7 +1244,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawFilledRectangle(string drawList, int width, int height) { - CheckThreatLevel(ThreatLevel.None, "osDrawFilledRectangle"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "FillRectangle " + width + "," + height + "; "; @@ -1227,7 +1253,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y) { - CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon"); + CheckThreatLevel(); m_host.AddScriptLPS(1); @@ -1246,7 +1272,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawPolygon(string drawList, LSL_List x, LSL_List y) { - CheckThreatLevel(ThreatLevel.None, "osDrawPolygon"); + CheckThreatLevel(); m_host.AddScriptLPS(1); @@ -1265,7 +1291,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetFontSize(string drawList, int fontSize) { - CheckThreatLevel(ThreatLevel.None, "osSetFontSize"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "FontSize "+ fontSize +"; "; @@ -1274,7 +1300,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetFontName(string drawList, string fontName) { - CheckThreatLevel(ThreatLevel.None, "osSetFontName"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "FontName "+ fontName +"; "; @@ -1283,7 +1309,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetPenSize(string drawList, int penSize) { - CheckThreatLevel(ThreatLevel.None, "osSetPenSize"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "PenSize " + penSize + "; "; @@ -1292,7 +1318,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetPenColor(string drawList, string color) { - CheckThreatLevel(ThreatLevel.None, "osSetPenColor"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "PenColor " + color + "; "; @@ -1302,7 +1328,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Deprecated public string osSetPenColour(string drawList, string colour) { - CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); + CheckThreatLevel(); OSSLDeprecated("osSetPenColour", "osSetPenColor"); m_host.AddScriptLPS(1); @@ -1312,7 +1338,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetPenCap(string drawList, string direction, string type) { - CheckThreatLevel(ThreatLevel.None, "osSetPenCap"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList += "PenCap " + direction + "," + type + "; "; @@ -1321,7 +1347,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osDrawImage(string drawList, int width, int height, string imageUrl) { - CheckThreatLevel(ThreatLevel.None, "osDrawImage"); + CheckThreatLevel(); m_host.AddScriptLPS(1); drawList +="Image " +width + "," + height+ ","+ imageUrl +"; " ; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index c12490c..19cfcc1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -228,6 +228,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osDrawFilledRectangle(string drawList, int width, int height); string osDrawPolygon(string drawList, LSL_List x, LSL_List y); string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y); + string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y); + string osDrawRotationTransform(string drawList, LSL_Float x); + string osDrawResetTransform(string drawList); string osSetFontName(string drawList, string fontName); string osSetFontSize(string drawList, int fontSize); string osSetPenSize(string drawList, int penSize); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 9bc3159..4b1f6d3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -386,6 +386,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osDrawFilledPolygon(drawList, x, y); } + public string osDrawTranslationTransform(string drawList, LSL_Float x, LSL_Float y) + { + return m_OSSL_Functions.osDrawTranslationTransform(drawList, x, y); + } + + public string osDrawRotationTransform(string drawList, LSL_Float x) + { + return m_OSSL_Functions.osDrawRotationTransform(drawList, x); + } + + public string osDrawResetTransform(string drawList) + { + return m_OSSL_Functions.osDrawResetTransform(drawList); + } + public string osSetFontSize(string drawList, int fontSize) { return m_OSSL_Functions.osSetFontSize(drawList, fontSize); -- cgit v1.1