Implements osDrawPolygon, similar to already implemented osDrawFilledPolygon

remotes/origin/0.6.7-post-fixes
Arthur Valadares 2009-08-28 17:48:03 -03:00
parent 33004b613d
commit 3d6edc04a3
4 changed files with 31 additions and 0 deletions

View File

@ -484,6 +484,12 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
GetParams(partsDelimiter, ref nextLine, 11, ref points);
graph.FillPolygon(myBrush, points);
}
else if (nextLine.StartsWith("Polygon"))
{
PointF[] points = null;
GetParams(partsDelimiter, ref nextLine, 7, ref points);
graph.DrawPolygon(drawPen, points);
}
else if (nextLine.StartsWith("Ellipse"))
{
float x = 0;

View File

@ -852,6 +852,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return drawList;
}
public string osDrawPolygon(string drawList, LSL_List x, LSL_List y)
{
CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon");
m_host.AddScriptLPS(1);
if (x.Length != y.Length || x.Length < 3)
{
return "";
}
drawList += "Polygon " + x.GetLSLStringItem(0) + "," + y.GetLSLStringItem(0);
for (int i = 1; i < x.Length; i++)
{
drawList += "," + x.GetLSLStringItem(i) + "," + y.GetLSLStringItem(i);
}
drawList += "; ";
return drawList;
}
public string osSetFontSize(string drawList, int fontSize)
{
CheckThreatLevel(ThreatLevel.None, "osSetFontSize");

View File

@ -97,6 +97,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
string osDrawEllipse(string drawList, int width, int height);
string osDrawRectangle(string drawList, int width, int height);
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 osSetFontSize(string drawList, int fontSize);
string osSetPenSize(string drawList, int penSize);

View File

@ -267,6 +267,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osDrawFilledRectangle(drawList, width, height);
}
public string osDrawPolygon(string drawList, LSL_List x, LSL_List y)
{
return m_OSSL_Functions.osDrawPolygon(drawList, x, y);
}
public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y)
{
return m_OSSL_Functions.osDrawFilledPolygon(drawList, x, y);