Implements osDrawPolygon, similar to already implemented osDrawFilledPolygon
parent
33004b613d
commit
3d6edc04a3
|
@ -484,6 +484,12 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
||||||
GetParams(partsDelimiter, ref nextLine, 11, ref points);
|
GetParams(partsDelimiter, ref nextLine, 11, ref points);
|
||||||
graph.FillPolygon(myBrush, 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"))
|
else if (nextLine.StartsWith("Ellipse"))
|
||||||
{
|
{
|
||||||
float x = 0;
|
float x = 0;
|
||||||
|
|
|
@ -852,6 +852,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return drawList;
|
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)
|
public string osSetFontSize(string drawList, int fontSize)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.None, "osSetFontSize");
|
CheckThreatLevel(ThreatLevel.None, "osSetFontSize");
|
||||||
|
|
|
@ -97,6 +97,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
string osDrawEllipse(string drawList, int width, int height);
|
string osDrawEllipse(string drawList, int width, int height);
|
||||||
string osDrawRectangle(string drawList, int width, int height);
|
string osDrawRectangle(string drawList, int width, int height);
|
||||||
string osDrawFilledRectangle(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 osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y);
|
||||||
string osSetFontSize(string drawList, int fontSize);
|
string osSetFontSize(string drawList, int fontSize);
|
||||||
string osSetPenSize(string drawList, int penSize);
|
string osSetPenSize(string drawList, int penSize);
|
||||||
|
|
|
@ -267,6 +267,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
return m_OSSL_Functions.osDrawFilledRectangle(drawList, width, height);
|
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)
|
public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y)
|
||||||
{
|
{
|
||||||
return m_OSSL_Functions.osDrawFilledPolygon(drawList, x, y);
|
return m_OSSL_Functions.osDrawFilledPolygon(drawList, x, y);
|
||||||
|
|
Loading…
Reference in New Issue