--User changes

-Remove the option --intpalette to format the palette in the xml as ints. If they are not hex formatted, then they should always be float. This option was pointless.
 -Cleanup some options text for the command line programs.
 -Allow for dragging around flames in the library tab. This is useful for setting up the order of an animation.
 -Make the opening of large files in Fractorium much more efficient when not-appending.
 -Make the opening of large files in all EmberRender and EmberAnimate more efficient.
 -Better error reporting when opening files.

--Bug fixes
 -Get rid of leftover artifacts that would appear on preview thumbnails when either switching SP/DP or re-rendering previews.
 -Filename extension was not being appended on Linux when saving as Xml, thus making it impossible to drag that file back in becase drop is filtered on extension.

--Code changes
 -Move GCC compiler spec to C++14. Building with 5.3 now on linux.
 -Use inline member data initializers.
 -Make a #define for static for use in Utils.h to make things a little cleaner.
 -Make various functions able to take arbitrary collections as their parameters rather than just vectors.
 -Make library collection a list rather than vector. This alleviates the need to re-sync pointers whenever the collection changes.
 -Subclass QTreeWidget for the library tree. Two new files added for this.
 -Remove all usage of #ifdef ROW_ONLY_DE in DEOpenCLKernelCreator, it was never used.
 -Add move constructor and assignment operator to EmberFile.
 -Add the ability to use a pointer to outside memory in the renderer for the vector of Ember<T>.
 -Make a lot more functions const where they should be.
This commit is contained in:
mfeemster
2016-04-03 18:55:12 -07:00
parent 124f807772
commit b690bf8071
64 changed files with 890 additions and 1048 deletions

View File

@ -17,11 +17,10 @@ class EmberFile
{
public:
/// <summary>
/// Empty constructor that does nothing.
/// Default constructor and destructor.
/// </summary>
EmberFile()
{
}
EmberFile() = default;
~EmberFile() = default;
/// <summary>
/// Default copy constructor.
@ -63,7 +62,31 @@ public:
EmberFile<T>& operator = (const EmberFile<U>& emberFile)
{
m_Filename = emberFile.m_Filename;
CopyVec(m_Embers, emberFile.m_Embers);
CopyCont(m_Embers, emberFile.m_Embers);
return *this;
}
/// <summary>
/// Move constructor.
/// </summary>
/// <param name="emberFile">The EmberFile object to move</param>
EmberFile(EmberFile<T>&& emberFile)
{
EmberFile<T>::operator=<T>(emberFile);
}
/// <summary>
/// Move assignment operator.
/// </summary>
/// <param name="emberFile">The EmberFile object to move</param>
EmberFile<T>& operator = (EmberFile<T>&& emberFile)
{
if (this != &emberFile)
{
m_Filename = emberFile.m_Filename;
m_Embers = std::move(emberFile.m_Embers);
}
return *this;
}
@ -84,6 +107,19 @@ public:
return m_Embers.size();
}
/// <summary>
/// Get a pointer to the ember at the specified index.
/// </summary>
/// <param name="i">The index of the ember to retrieve</param>
/// <returns>A pointer to the ember if it was within bounds, else nullptr.</returns>
Ember<T>* Get(size_t i)
{
if (i < m_Embers.size())
return &(*Advance(m_Embers.begin(), i));
return nullptr;
}
/// <summary>
/// Delete the ember at the given index.
/// Will not delete anything if the size is already 1.
@ -94,7 +130,7 @@ public:
{
if (Size() > 1 && index < Size())
{
m_Embers.erase(m_Embers.begin() + index);
m_Embers.erase(Advance(m_Embers.begin(), index));
return true;
}
else
@ -106,14 +142,14 @@ public:
/// </summary>
void MakeNamesUnique()
{
for (size_t i = 0; i < m_Embers.size(); i++)
for (auto it1 = m_Embers.begin(); it1 != m_Embers.end(); ++it1)
{
for (size_t j = 0; j < m_Embers.size(); j++)
for (auto it2 = m_Embers.begin(); it2 != m_Embers.end(); ++it2)
{
if (i != j && m_Embers[i].m_Name == m_Embers[j].m_Name)
if (it1 != it2 && it1->m_Name == it2->m_Name)
{
m_Embers[j].m_Name = IncrementTrailingUnderscoreInt(QString::fromStdString(m_Embers[j].m_Name)).toStdString();
j = 0;
it2->m_Name = IncrementTrailingUnderscoreInt(QString::fromStdString(it2->m_Name)).toStdString();
it2 = m_Embers.begin();
}
}
}
@ -195,5 +231,5 @@ public:
}
QString m_Filename;
vector<Ember<T>> m_Embers;
list<Ember<T>> m_Embers;
};