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:
@ -165,18 +165,6 @@ Fractorium::~Fractorium()
|
||||
m_Settings->sync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stop the render timer and start the delayed restart timer.
|
||||
/// This is a massive hack because Qt has no way of detecting when a resize event
|
||||
/// is started and stopped. Detecting if mouse buttons down is also not an option
|
||||
/// because the documentation says it gives the wrong result.
|
||||
/// </summary>
|
||||
void Fractorium::Resize()
|
||||
{
|
||||
if (!QCoreApplication::closingDown())
|
||||
m_Controller->DelayedStartRenderTimer();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the coordinate text in the status bar.
|
||||
/// </summary>
|
||||
@ -198,11 +186,9 @@ void Fractorium::SetCoordinateStatus(int x, int y, float worldX, float worldY)
|
||||
template <typename T>
|
||||
void FractoriumEmberController<T>::ApplyXmlSavingTemplate(Ember<T>& ember)
|
||||
{
|
||||
ember.m_FinalRasW = m_Fractorium->m_Settings->XmlWidth();
|
||||
ember.m_FinalRasH = m_Fractorium->m_Settings->XmlHeight();
|
||||
ember.m_TemporalSamples = m_Fractorium->m_Settings->XmlTemporalSamples();
|
||||
ember.m_Quality = m_Fractorium->m_Settings->XmlQuality();
|
||||
ember.m_Supersample = m_Fractorium->m_Settings->XmlSupersample();
|
||||
ember.m_TemporalSamples = m_Fractorium->m_Settings->XmlTemporalSamples();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -260,11 +246,13 @@ void Fractorium::dockLocationChanged(Qt::DockWidgetArea area)
|
||||
/// </summary>
|
||||
|
||||
/// <summary>
|
||||
/// Resize event, just pass to base.
|
||||
/// Resize event, change width and height double click values to match the window size.
|
||||
/// </summary>
|
||||
/// <param name="e">The event</param>
|
||||
void Fractorium::resizeEvent(QResizeEvent* e)
|
||||
{
|
||||
m_WidthSpin->DoubleClickNonZero(ui.GLParentScrollArea->width());
|
||||
m_HeightSpin->DoubleClickNonZero(ui.GLParentScrollArea->height());
|
||||
QMainWindow::resizeEvent(e);
|
||||
}
|
||||
|
||||
@ -362,7 +350,7 @@ void Fractorium::dropEvent(QDropEvent* e)
|
||||
void Fractorium::SetupCombo(QTableWidget* table, const QObject* receiver, int& row, int col, StealthComboBox*& comboBox, vector<string>& vals, const char* signal, const char* slot, Qt::ConnectionType connectionType)
|
||||
{
|
||||
comboBox = new StealthComboBox(table);
|
||||
ForEach(vals, [&](string s) { comboBox->addItem(s.c_str()); });
|
||||
ForEach(vals, [&](const string& s) { comboBox->addItem(s.c_str()); });
|
||||
table->setCellWidget(row, col, comboBox);
|
||||
connect(comboBox, signal, receiver, slot, connectionType);
|
||||
row++;
|
||||
@ -425,7 +413,7 @@ QStringList Fractorium::SetupOpenXmlDialog()
|
||||
/// </summary>
|
||||
/// <param name="defaultFilename">The default filename to populate the text box with</param>
|
||||
/// <returns>The filename selected</returns>
|
||||
QString Fractorium::SetupSaveXmlDialog(QString defaultFilename)
|
||||
QString Fractorium::SetupSaveXmlDialog(const QString& defaultFilename)
|
||||
{
|
||||
//Lazy instantiate since it takes a long time.
|
||||
if (!m_FileDialog)
|
||||
@ -463,7 +451,7 @@ QString Fractorium::SetupSaveXmlDialog(QString defaultFilename)
|
||||
/// </summary>
|
||||
/// <param name="defaultFilename">The default filename to populate the text box with</param>
|
||||
/// <returns>The filename selected</returns>
|
||||
QString Fractorium::SetupSaveImageDialog(QString defaultFilename)
|
||||
QString Fractorium::SetupSaveImageDialog(const QString& defaultFilename)
|
||||
{
|
||||
//Lazy instantiate since it takes a long time.
|
||||
if (!m_FileDialog)
|
||||
@ -502,7 +490,7 @@ QString Fractorium::SetupSaveImageDialog(QString defaultFilename)
|
||||
/// Setup and show the save folder dialog.
|
||||
/// This will perform lazy instantiation.
|
||||
/// </summary>
|
||||
/// <returns>The folder selected</returns>
|
||||
/// <returns>The folder selected, with '/' appended to the end</returns>
|
||||
QString Fractorium::SetupSaveFolderDialog()
|
||||
{
|
||||
//Lazy instantiate since it takes a long time.
|
||||
@ -528,11 +516,28 @@ QString Fractorium::SetupSaveFolderDialog()
|
||||
m_FolderDialog->setDirectory(m_Settings->SaveFolder());
|
||||
|
||||
if (m_FolderDialog->exec() == QDialog::Accepted)
|
||||
filename = m_FolderDialog->selectedFiles().value(0);
|
||||
{
|
||||
filename = MakeEnd(m_FolderDialog->selectedFiles().value(0), '/');
|
||||
}
|
||||
|
||||
return filename;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Thin wrapper around QMessageBox::critical() to allow it to be invoked from another thread.
|
||||
/// </summary>
|
||||
void Fractorium::ShowCritical(const QString& title, const QString& text, bool invokeRequired)
|
||||
{
|
||||
if (!invokeRequired)
|
||||
{
|
||||
QMessageBox::critical(this, title, text);
|
||||
}
|
||||
else
|
||||
{
|
||||
QMetaObject::invokeMethod(this, "ShowCritical", Qt::QueuedConnection, Q_ARG(const QString&, title), Q_ARG(const QString&, text), Q_ARG(bool, false));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Explicitly set the tab orders for the entire program.
|
||||
/// Qt has a facility to do this, but it fails when using custom widgets in
|
||||
|
Reference in New Issue
Block a user