diff --git a/Builds/MSVC/Installer/Product.wxs b/Builds/MSVC/Installer/Product.wxs index ac5ca09..be98650 100644 --- a/Builds/MSVC/Installer/Product.wxs +++ b/Builds/MSVC/Installer/Product.wxs @@ -168,19 +168,19 @@ - + - + - + - + - + diff --git a/Source/Ember/Variations02.h b/Source/Ember/Variations02.h index 725e39c..9527d61 100644 --- a/Source/Ember/Variations02.h +++ b/Source/Ember/Variations02.h @@ -86,7 +86,7 @@ public: string holesweight = "parVars[" + ToUpper(m_Params[i++].Name()) + index; ss << "\t{\n" << "\t\treal_t theta = precalcAtanyx;\n" - << "\t\treal_t t = (!" << thicknessweight << " ? " << weight << " : MwcNext01(mwc) * " << thicknessweight << ") / cos(" << n << " * theta) - " << holesweight << ";\n" + << "\t\treal_t t = (" << thicknessweight << " == (real_t)(0.0) ? " << weight << " : MwcNext01(mwc) * " << thicknessweight << ") / cos(" << n << " * theta) - " << holesweight << ";\n" << "\n" << "\t\tif (fabs(t) != 0)\n" << "\t\t{\n" diff --git a/Source/Ember/Variations07.h b/Source/Ember/Variations07.h index 7ac56e9..1184fdc 100644 --- a/Source/Ember/Variations07.h +++ b/Source/Ember/Variations07.h @@ -1597,8 +1597,8 @@ public: << "\n" << "\t\t//exponential to make a tiled circle\n" << "\t\treal_t rangle = floor(MwcNext01(mwc) * " << p3nprecalc << ") * M_2PI * " << p13nprecalc << ";\n" - << "\t\treal_t y_aux = " << flipy << " ? (add ? vIn.y : -vIn.y) : vIn.y;\n" - << "\t\treal_t x_aux = " << flipx << " ? (add ? vIn.x : -vIn.x) : vIn.x;\n" + << "\t\treal_t y_aux = " << flipy << " != (real_t)(0.0) ? (add ? vIn.y : -vIn.y) : vIn.y;\n" + << "\t\treal_t x_aux = " << flipx << " != (real_t)(0.0) ? (add ? vIn.x : -vIn.x) : vIn.x;\n" << "\t\treal_t FY = y_aux * " << p13nprecalc << ";\n" << "\t\treal_t FX = x_aux * " << p13nprecalc << ";\n" << "\t\treal_t ang = fma(FY, MPI, rangle);\n" @@ -7303,7 +7303,7 @@ public: sinx = T(0.5) * (T(1.0) + std::sin(helper.In.y * m_Freqx)); } - T offsetx = std::pow(sinx, px) * m_Scalex; + T offsetx = T(std::pow(sinx, px) * m_Scalex); if (m_Modey < T(0.5)) { @@ -7314,7 +7314,7 @@ public: siny = T(0.5) * (T(1.0) + std::sin(helper.In.x * m_Freqy)); } - T offsety = std::pow(siny, py) * m_Scaley; + T offsety = T(std::pow(siny, py) * m_Scaley); helper.Out.x = m_Weight * (helper.In.x + offsetx); helper.Out.y = m_Weight * (helper.In.y + offsety); helper.Out.z = DefaultZ(helper); diff --git a/Source/Fractorium/EmberFile.h b/Source/Fractorium/EmberFile.h index 17cf550..6d77d27 100644 --- a/Source/Fractorium/EmberFile.h +++ b/Source/Fractorium/EmberFile.h @@ -208,13 +208,13 @@ public: QString base = original.completeBaseName(); const QString path = original.absolutePath() + '/'; const QString extension = original.suffix(); + newPath = path + base + "." + extension; - do + while (QFile::exists(newPath)) { base = IncrementTrailingUnderscoreInt(base); newPath = path + base + "." + extension; } - while (QFile::exists(newPath)); return newPath; } diff --git a/Source/Fractorium/FinalRenderEmberController.cpp b/Source/Fractorium/FinalRenderEmberController.cpp index 2e66bc2..a3407c3 100644 --- a/Source/Fractorium/FinalRenderEmberController.cpp +++ b/Source/Fractorium/FinalRenderEmberController.cpp @@ -733,11 +733,11 @@ tuple FinalRenderEmberController::SyncAndComputeMemor /// The base filename to compose a full path for /// The fully composed path template -QString FinalRenderEmberController::ComposePath(const QString& name) +QString FinalRenderEmberController::ComposePath(const QString& name, bool unique) { const auto path = MakeEnd(m_Settings->SaveFolder(), '/');//Base path. const auto full = path + m_FinalRenderDialog->Prefix() + name + m_FinalRenderDialog->Suffix() + "." + m_FinalRenderDialog->Ext(); - return EmberFile::UniqueFilename(full); + return unique ? EmberFile::UniqueFilename(full) : full; } /// @@ -939,14 +939,15 @@ void FinalRenderEmberController::RenderComplete(Ember& ember, const EmberS rlg l(m_ProgressCs); const auto renderTimeString = renderTimer.Format(renderTimer.Toc()); QString status; - const auto filename = ComposePath(QString::fromStdString(ember.m_Name)); + const auto filename = ComposePath(QString::fromStdString(ember.m_Name), false); const auto itersString = ToString(stats.m_Iters); const auto itersPerSecString = ToString(static_cast(stats.m_Iters / (stats.m_IterMs / 1000.0))); if (m_GuiState.m_SaveXml) { const QFileInfo xmlFileInfo(filename);//Create another one in case it was modified for batch rendering. - const QString newPath = xmlFileInfo.absolutePath() + '/' + xmlFileInfo.completeBaseName() + ".flame"; + QString newPath = xmlFileInfo.absolutePath() + '/' + xmlFileInfo.completeBaseName() + ".flame"; + newPath = EmberFile::UniqueFilename(newPath); const xmlDocPtr tempEdit = ember.m_Edits; ember.m_Edits = m_XmlWriter.CreateNewEditdoc(&ember, nullptr, "edit", m_Settings->Nick().toStdString(), m_Settings->Url().toStdString(), m_Settings->Id().toStdString(), "", 0, 0); m_XmlWriter.Save(newPath.toStdString().c_str(), ember, 0, true, false, true);//Note that the ember passed is used, rather than m_Ember because it's what was actually rendered. diff --git a/Source/Fractorium/FinalRenderEmberController.h b/Source/Fractorium/FinalRenderEmberController.h index 6707ff7..464b783 100644 --- a/Source/Fractorium/FinalRenderEmberController.h +++ b/Source/Fractorium/FinalRenderEmberController.h @@ -68,7 +68,7 @@ public: virtual void ResetProgress(bool total = true) { } virtual tuple SyncAndComputeMemory() { return tuple(0, 0, 0); } virtual double OriginalAspect() { return 1; } - virtual QString ComposePath(const QString& name) { return ""; } + virtual QString ComposePath(const QString& name, bool unique = true) { return ""; } virtual bool BumpQualityRender(double d) { return false; } virtual QString SaveCurrentAgain() { return ""; } virtual void CancelRender() { } @@ -132,7 +132,7 @@ public: tuple SyncAndComputeMemory() override; double OriginalAspect() override { return double(m_Ember->m_OrigFinalRasW) / m_Ember->m_OrigFinalRasH; } QString Name() const override { return QString::fromStdString(m_Ember->m_Name); } - QString ComposePath(const QString& name) override; + QString ComposePath(const QString& name, bool unique = true) override; QString SaveCurrentAgain() override; void CancelRender() override; QString CheckMemory(const tuple& p) override;