--Bug fixes

-mirror_x, y and z variations were totally wrong.
 -Reading color curves from older version 2 .chaos files which did not have the "knots" and "values" names was broken.
This commit is contained in:
Person
2019-05-22 20:33:19 -07:00
parent 28ce868a9f
commit a9650e6b43
2 changed files with 110 additions and 113 deletions

View File

@ -1234,14 +1234,59 @@ bool XmlToEmber<T>::ParseEmberElementFromChaos(xmlNode* emberNode, Ember<T>& cur
vector<v2F> vals;
if (auto knotsnode = GetChildNode(node, "knots"))
{
if (auto knotvalsnode = GetChildNodeByNodeName(knotsnode, "values"))
if (knotvalsnode->children)
knots = CCX(knotvalsnode->children->content);
}
if (auto valuesnode = GetChildNode(node, "values"))
{
if (auto valvalsnode = GetChildNodeByNodeName(valuesnode, "values"))
if (valvalsnode->children)
values = CCX(valvalsnode->children->content);
}
if (knots.empty() && values.empty())
{
bool haveknots = false, havevals = false;
for (auto childNode = node->children; childNode; childNode = childNode->next)
{
if (childNode->type == XML_ELEMENT_NODE)
{
if (auto node = CheckNodeName(childNode, "table"))
{
if (!haveknots)
{
if (auto knotvalsnode = GetChildNodeByNodeName(node, "values"))
{
if (knotvalsnode->children)
{
knots = CCX(knotvalsnode->children->content);
haveknots = true;
}
continue;
}
}
else if (!havevals)
{
if (auto valvalsnode = GetChildNodeByNodeName(node, "values"))
{
if (valvalsnode->children)
{
values = CCX(valvalsnode->children->content);
havevals = true;
}
continue;
}
}
}
}
}
}
istringstream kistr(knots);
istringstream vistr(values);