diff options
author | Arthur Valadares | 2009-08-28 17:48:03 -0300 |
---|---|---|
committer | Arthur Valadares | 2009-08-28 17:48:03 -0300 |
commit | 3d6edc04a309757ce025e74aaf7168ef759a2ef3 (patch) | |
tree | 2523e70e2810467561a35b6f1e04c75dbdc77e7a /OpenSim/Region | |
parent | Standardize FlotsamAssetCache header (diff) | |
download | opensim-SC-3d6edc04a309757ce025e74aaf7168ef759a2ef3.zip opensim-SC-3d6edc04a309757ce025e74aaf7168ef759a2ef3.tar.gz opensim-SC-3d6edc04a309757ce025e74aaf7168ef759a2ef3.tar.bz2 opensim-SC-3d6edc04a309757ce025e74aaf7168ef759a2ef3.tar.xz |
Implements osDrawPolygon, similar to already implemented osDrawFilledPolygon
Diffstat (limited to 'OpenSim/Region')
4 files changed, 31 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index e577fbe..e83b1a8 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -484,6 +484,12 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
484 | GetParams(partsDelimiter, ref nextLine, 11, ref points); | 484 | GetParams(partsDelimiter, ref nextLine, 11, ref points); |
485 | graph.FillPolygon(myBrush, points); | 485 | graph.FillPolygon(myBrush, points); |
486 | } | 486 | } |
487 | else if (nextLine.StartsWith("Polygon")) | ||
488 | { | ||
489 | PointF[] points = null; | ||
490 | GetParams(partsDelimiter, ref nextLine, 7, ref points); | ||
491 | graph.DrawPolygon(drawPen, points); | ||
492 | } | ||
487 | else if (nextLine.StartsWith("Ellipse")) | 493 | else if (nextLine.StartsWith("Ellipse")) |
488 | { | 494 | { |
489 | float x = 0; | 495 | float x = 0; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index b1c357c..0de5c9b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -852,6 +852,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
852 | return drawList; | 852 | return drawList; |
853 | } | 853 | } |
854 | 854 | ||
855 | public string osDrawPolygon(string drawList, LSL_List x, LSL_List y) | ||
856 | { | ||
857 | CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon"); | ||
858 | |||
859 | m_host.AddScriptLPS(1); | ||
860 | |||
861 | if (x.Length != y.Length || x.Length < 3) | ||
862 | { | ||
863 | return ""; | ||
864 | } | ||
865 | drawList += "Polygon " + x.GetLSLStringItem(0) + "," + y.GetLSLStringItem(0); | ||
866 | for (int i = 1; i < x.Length; i++) | ||
867 | { | ||
868 | drawList += "," + x.GetLSLStringItem(i) + "," + y.GetLSLStringItem(i); | ||
869 | } | ||
870 | drawList += "; "; | ||
871 | return drawList; | ||
872 | } | ||
873 | |||
855 | public string osSetFontSize(string drawList, int fontSize) | 874 | public string osSetFontSize(string drawList, int fontSize) |
856 | { | 875 | { |
857 | CheckThreatLevel(ThreatLevel.None, "osSetFontSize"); | 876 | CheckThreatLevel(ThreatLevel.None, "osSetFontSize"); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 2365bee..b129b39 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -97,6 +97,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
97 | string osDrawEllipse(string drawList, int width, int height); | 97 | string osDrawEllipse(string drawList, int width, int height); |
98 | string osDrawRectangle(string drawList, int width, int height); | 98 | string osDrawRectangle(string drawList, int width, int height); |
99 | string osDrawFilledRectangle(string drawList, int width, int height); | 99 | string osDrawFilledRectangle(string drawList, int width, int height); |
100 | string osDrawPolygon(string drawList, LSL_List x, LSL_List y); | ||
100 | string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y); | 101 | string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y); |
101 | string osSetFontSize(string drawList, int fontSize); | 102 | string osSetFontSize(string drawList, int fontSize); |
102 | string osSetPenSize(string drawList, int penSize); | 103 | 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 f877acb..45492dd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -267,6 +267,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
267 | return m_OSSL_Functions.osDrawFilledRectangle(drawList, width, height); | 267 | return m_OSSL_Functions.osDrawFilledRectangle(drawList, width, height); |
268 | } | 268 | } |
269 | 269 | ||
270 | public string osDrawPolygon(string drawList, LSL_List x, LSL_List y) | ||
271 | { | ||
272 | return m_OSSL_Functions.osDrawPolygon(drawList, x, y); | ||
273 | } | ||
274 | |||
270 | public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y) | 275 | public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y) |
271 | { | 276 | { |
272 | return m_OSSL_Functions.osDrawFilledPolygon(drawList, x, y); | 277 | return m_OSSL_Functions.osDrawFilledPolygon(drawList, x, y); |