add dyn textures vectorrender comands ''ResetTransf;'', ''TransTransf x,y;'' and ''RotTransf x'' string only, no ossl helper api still

0.9.0-post-fixes
UbitUmarov 2017-06-24 21:42:11 +01:00
parent 1a8a77c41e
commit 5d776fca3a
1 changed files with 29 additions and 1 deletions

View File

@ -511,8 +511,25 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
// m_log.DebugFormat("[VECTOR RENDER MODULE]: Processing line '{0}'", nextLine);
if (nextLine.StartsWith("ResetTransf"))
{
graph.ResetTransform();
}
else if (nextLine.StartsWith("TransTransf"))
{
float x = 0;
float y = 0;
GetParams(partsDelimiter, ref nextLine, 11, ref x, ref y);
graph.TranslateTransform(x, y);
}
else if (nextLine.StartsWith("RotTransf"))
{
float x = 0;
GetParams(partsDelimiter, ref nextLine, 9, ref x);
graph.RotateTransform(x);
}
//replace with switch, or even better, do some proper parsing
if (nextLine.StartsWith("MoveTo"))
else if (nextLine.StartsWith("MoveTo"))
{
float x = 0;
float y = 0;
@ -793,6 +810,17 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
}
}
private static void GetParams(char[] partsDelimiter, ref string line, int startLength, ref float x)
{
line = line.Remove(0, startLength);
string[] parts = line.Split(partsDelimiter);
if (parts.Length > 0)
{
string xVal = parts[0].Trim();
x = Convert.ToSingle(xVal, CultureInfo.InvariantCulture);
}
}
private static void GetParams(char[] partsDelimiter, ref string line, int startLength, ref float x, ref float y)
{
line = line.Remove(0, startLength);