* Helpers.GetResourceStream() now uses the executable directory + openmetaverse_data as the path for finding resources instead of current directory + openmetaverse_data

* Added add, subtract, multiply operators to Color4
* Switched baking to use Color4 instead of System.Drawing.Color
* Untested implementation of multiply and add color operations in baking

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3077 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2009-08-12 06:11:36 +00:00
parent 41b7ad90c1
commit 04f920aea9
7 changed files with 129 additions and 106 deletions

View File

@@ -55,10 +55,10 @@ namespace VisualParamGenerator
{
// Read in avatar_lad.xml
Stream stream = OpenMetaverse.Helpers.GetResourceStream("avatar_lad.xml");
StreamReader reader = new StreamReader(stream);
if (stream != null)
{
StreamReader reader = new StreamReader(stream);
XmlDocument doc = new XmlDocument();
doc.LoadXml(reader.ReadToEnd());
list = doc.GetElementsByTagName("param");
@@ -168,7 +168,7 @@ namespace VisualParamGenerator
else if (node.ChildNodes[nodeNr].Name == "param_color" && node.ChildNodes[nodeNr].HasChildNodes)
{
XmlNode cnode = node.ChildNodes[nodeNr];
string operation = "VisualColorOperation.None";
string operation = "VisualColorOperation.Add";
List<string> colors = new List<string>();
if (cnode.Attributes["operation"] != null)
@@ -196,14 +196,14 @@ namespace VisualParamGenerator
continue;
}
CaptureCollection val = m.Groups["val"].Captures;
colors.Add(string.Format("System.Drawing.Color.FromArgb({0}, {1}, {2}, {3})", val[3], val[0], val[1], val[2]));
colors.Add(string.Format("new Color4({0}, {1}, {2}, {3})", val[3], val[0], val[1], val[2]));
}
}
if (colors.Count > 0 && !skipColor)
{
string colorsStr = string.Join(", ", colors.ToArray());
Colors.Add(id, string.Format("new VisualColorParam({0}, new System.Drawing.Color[] {{ {1} }})", operation, colorsStr));
Colors.Add(id, string.Format("new VisualColorParam({0}, new Color4[] {{ {1} }})", operation, colorsStr));
}
}
#endregion