mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-02-01 10:30:08 -05:00
--Bug fixes
-Make xaos pasting options apply all of the time even if there is no xaos.
This commit is contained in:
parent
1ba1e0925f
commit
ab836aaa82
@ -216,82 +216,76 @@ void Fractorium::OnAddLinkedXformButtonClicked(bool checked) { m_Controller->Add
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void FractoriumEmberController<T>::AddXformsWithXaos(Ember<T>& ember, std::vector<std::pair<Xform<T>, size_t>>& xforms, bool preserveXaos, eXaosPasteStyle pastestyle)
|
void FractoriumEmberController<T>::AddXformsWithXaos(Ember<T>& ember, std::vector<std::pair<Xform<T>, size_t>>& xforms, bool preserveXaos, eXaosPasteStyle pastestyle)
|
||||||
{
|
{
|
||||||
if (ember.XaosPresent())
|
auto oldxfcount = ember.XformCount();
|
||||||
|
|
||||||
|
for (auto& it : xforms)
|
||||||
{
|
{
|
||||||
auto oldxfcount = ember.XformCount();
|
ember.AddXform(it.first);
|
||||||
|
auto newxfcount = ember.XformCount() - 1;
|
||||||
|
auto* newxform = ember.GetXform(newxfcount);
|
||||||
|
|
||||||
for (auto& it : xforms)
|
for (size_t i = 0; i < oldxfcount; i++)
|
||||||
{
|
|
||||||
ember.AddXform(it.first);
|
|
||||||
auto newxfcount = ember.XformCount() - 1;
|
|
||||||
auto* newxform = ember.GetXform(newxfcount);
|
|
||||||
|
|
||||||
for (size_t i = 0; i < oldxfcount; i++)
|
|
||||||
{
|
|
||||||
if (auto xform = ember.GetXform(i))
|
|
||||||
{
|
|
||||||
switch (pastestyle)
|
|
||||||
{
|
|
||||||
case EmberCommon::eXaosPasteStyle::NONE:
|
|
||||||
newxform->SetXaos(i, 1);
|
|
||||||
xform->SetXaos(newxfcount, 1);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EmberCommon::eXaosPasteStyle::ZERO_TO_ONE:
|
|
||||||
case EmberCommon::eXaosPasteStyle::ZERO_TO_VALS:
|
|
||||||
newxform->SetXaos(i, 0);
|
|
||||||
xform->SetXaos(newxfcount, 0);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EmberCommon::eXaosPasteStyle::ONE_TO_VALS:
|
|
||||||
newxform->SetXaos(i, 1);
|
|
||||||
xform->SetXaos(newxfcount, 1);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EmberCommon::eXaosPasteStyle::VALS_TO_ONE:
|
|
||||||
newxform->SetXaos(i, it.first.Xaos(i));
|
|
||||||
xform->SetXaos(newxfcount, xform->Xaos(it.second));
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t i = oldxfcount; i < ember.XformCount(); i++)
|
|
||||||
{
|
{
|
||||||
if (auto xform = ember.GetXform(i))
|
if (auto xform = ember.GetXform(i))
|
||||||
{
|
{
|
||||||
for (size_t j = oldxfcount; j < ember.XformCount(); j++)
|
switch (pastestyle)
|
||||||
{
|
{
|
||||||
switch (pastestyle)
|
case EmberCommon::eXaosPasteStyle::NONE:
|
||||||
{
|
newxform->SetXaos(i, 1);
|
||||||
case EmberCommon::eXaosPasteStyle::NONE:
|
xform->SetXaos(newxfcount, 1);
|
||||||
case EmberCommon::eXaosPasteStyle::ZERO_TO_ONE:
|
break;
|
||||||
xform->SetXaos(j, 1);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EmberCommon::eXaosPasteStyle::ZERO_TO_VALS:
|
case EmberCommon::eXaosPasteStyle::ZERO_TO_ONE:
|
||||||
case EmberCommon::eXaosPasteStyle::ONE_TO_VALS:
|
case EmberCommon::eXaosPasteStyle::ZERO_TO_VALS:
|
||||||
xform->SetXaos(j, xforms[i - oldxfcount].first.Xaos(j - oldxfcount));
|
newxform->SetXaos(i, 0);
|
||||||
break;
|
xform->SetXaos(newxfcount, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
case EmberCommon::eXaosPasteStyle::VALS_TO_ONE:
|
case EmberCommon::eXaosPasteStyle::ONE_TO_VALS:
|
||||||
xform->SetXaos(j, 1);
|
newxform->SetXaos(i, 1);
|
||||||
break;
|
xform->SetXaos(newxfcount, 1);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
case EmberCommon::eXaosPasteStyle::VALS_TO_ONE:
|
||||||
break;
|
newxform->SetXaos(i, it.first.Xaos(i));
|
||||||
}
|
xform->SetXaos(newxfcount, xform->Xaos(it.second));
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t i = oldxfcount; i < ember.XformCount(); i++)
|
||||||
|
{
|
||||||
|
if (auto xform = ember.GetXform(i))
|
||||||
|
{
|
||||||
|
for (size_t j = oldxfcount; j < ember.XformCount(); j++)
|
||||||
|
{
|
||||||
|
switch (pastestyle)
|
||||||
|
{
|
||||||
|
case EmberCommon::eXaosPasteStyle::NONE:
|
||||||
|
case EmberCommon::eXaosPasteStyle::ZERO_TO_ONE:
|
||||||
|
xform->SetXaos(j, 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EmberCommon::eXaosPasteStyle::ZERO_TO_VALS:
|
||||||
|
case EmberCommon::eXaosPasteStyle::ONE_TO_VALS:
|
||||||
|
xform->SetXaos(j, xforms[i - oldxfcount].first.Xaos(j - oldxfcount));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EmberCommon::eXaosPasteStyle::VALS_TO_ONE:
|
||||||
|
xform->SetXaos(j, 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
for (auto& it : xforms)
|
|
||||||
ember.AddXform(it.first);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user