mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-12 03:04:51 -04:00
0.4.1.3 Beta 10/14/2014
--User Changes Size is no longer fixed to the window size. Size scaling is done differently in the final render dialog. This fixes several bugs. Remove Xml saving size from settings and options dialog, it no longer applies. Final render can be broken into strips. Set default save path to the desktop if none is found in the settings file. Set default output size to 1920x1080 if none is found in the settings file. --Bug Fixes Better memory size reporting in final render dialog. --Code Changes Migrate to C++11, Qt 5.3.1, and Visual Studio 2013. Change most instances of unsigned int to size_t, and int to intmax_t. Add m_OrigPixPerUnit and m_ScaleType to Ember for scaling purposes. Replace some sprintf_s() calls in XmlToEmber with ostringstream. Move more non-templated members into RendererBase. Add CopyVec() overload that takes a per element function pointer. Add vector Memset(). Replace '&' with '+' instead of "&" in XmlToEmber for much faster parsing. Break strips rendering out into EmberCommon and call from EmberRender and Fractorium. Make AddAndWriteBuffer() just call WriteBuffer(). Make AddAndWriteImage() delete the existing image first before replacing it. Add SetOutputTexture() to RendererCL to support making new textures in response to resize events. Remove multiple return statements in RendererCL, and replace with a bool that tracks results. Add ToDouble(), MakeEnd(), ToString() and Exists() wrappers in Fractorium. Add Size() wrapper in EmberFile. Make QString function arguments const QString&, and string with const string&. Make ShowCritical() wrapper for invoking a message box from another thread. Add combo box to TwoButtonWidget and rename.
This commit is contained in:
@ -115,7 +115,7 @@ public:
|
||||
/// Add string to report.
|
||||
/// </summary>
|
||||
/// <param name="s">The string to add</param>
|
||||
virtual void AddToReport(string s) { m_ErrorReport.push_back(s); }
|
||||
virtual void AddToReport(const string& s) { m_ErrorReport.push_back(s); }
|
||||
|
||||
/// <summary>
|
||||
/// Add a vector of strings to report.
|
||||
@ -138,7 +138,7 @@ public:
|
||||
{
|
||||
stringstream ss;
|
||||
|
||||
ForEach(errorReport, [&](string s) { ss << s << endl; });
|
||||
ForEach(errorReport, [&](const string& s) { ss << s << endl; });
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
@ -218,7 +218,28 @@ static void CopyVec(vector<T>& dest, const vector<U>& source)
|
||||
dest.resize(source.size());
|
||||
|
||||
for (size_t i = 0; i < source.size(); i++)
|
||||
dest[i] = T(source[i]);//Valid assignment operator between T and U types must be defined somewhere.
|
||||
dest[i] = (T)source[i];//Valid assignment operator between T and U types must be defined somewhere.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear dest and copy all of the elements of vector source with elements of type U to the vector
|
||||
/// dest with elements of type T.
|
||||
/// Call a function on each element after it's been copied.
|
||||
/// </summary>
|
||||
/// <param name="dest">The vector of type T to copy to</param>
|
||||
/// <param name="source">The vector of type U to copy from</param>
|
||||
/// <param name="perElementOperation">A function to call on each element after it's copied</param>
|
||||
template <typename T, typename U>
|
||||
static void CopyVec(vector<T>& dest, const vector<U>& source, std::function<void(T& t)> perElementOperation)
|
||||
{
|
||||
dest.clear();
|
||||
dest.resize(source.size());
|
||||
|
||||
for (size_t i = 0; i < source.size(); i++)
|
||||
{
|
||||
dest[i] = (T)source[i];//Valid assignment operator between T and U types must be defined somewhere.
|
||||
perElementOperation(dest[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -246,6 +267,18 @@ static void ClearVec(vector<T*>& vec, bool arrayDelete = false)
|
||||
vec.clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Thin wrapper around passing a vector to memset() to relieve
|
||||
/// the caller of having to pass the size.
|
||||
/// </summary>
|
||||
/// <param name="vec">The vector to memset</param>
|
||||
/// <param name="val">The value to set each element to, default 0.</param>
|
||||
template<typename T>
|
||||
static inline void Memset(vector<T>& vec, int val = 0)
|
||||
{
|
||||
memset((void*)vec.data(), val, vec.size() * sizeof(vec[0]));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// System floor() extremely slow because it accounts for various error conditions.
|
||||
/// This is a much faster version that works on data that is not NaN.
|
||||
@ -761,7 +794,7 @@ static string ToUpper(const string& str)
|
||||
/// <param name="str">The string to trim</param>
|
||||
/// <param name="ch">The character to trim. Default: space.</param>
|
||||
/// <returns>The trimmed string</returns>
|
||||
static string Trim(string& str, char ch = ' ')
|
||||
static string Trim(const string& str, char ch = ' ')
|
||||
{
|
||||
string ret;
|
||||
|
||||
|
Reference in New Issue
Block a user