--User changes

-Add a progress bar for sequence previews.

--Bug fixes
 -Attempt to prevent crash when dragging in a new file while the previews from the current file are still rendering.
This commit is contained in:
Person 2023-11-23 14:52:34 -07:00
parent 745f06d29d
commit b3ad38020e
20 changed files with 78 additions and 50 deletions

View File

@ -1,7 +1,7 @@
<Project Sdk="WixToolset.Sdk/4.0.0">
<PropertyGroup>
<ProductVersion>3.7</ProductVersion>
<OutputName>Fractorium_23.23.8.100</OutputName>
<OutputName>Fractorium_23.23.8.101</OutputName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>$(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\</OutputPath>

View File

@ -1,5 +1,5 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<?define ProductVersion="23.23.8.100" ?>
<?define ProductVersion="23.23.8.101" ?>
<?define ProductName="Fractorium $(var.ProductVersion) ($(var.GpuType))" ?>
<?define UpgradeCode="{4714cd15-bfba-44f6-8059-9e1466ebfa6e}"?>
<?define Manufacturer="Fractorium"?>
@ -12,7 +12,7 @@
<!--
Change this for every release.
-->
<?define ProductCode="{03DF885D-6E38-4185-8C2F-AA95EEAC6CB9}"?>
<?define ProductCode="{C4B772EF-F8FE-4327-9CE7-22308F363E69}"?>
<Package Name="$(var.ProductName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)" InstallerVersion="400" Scope="perMachine" ProductCode="$(var.ProductCode)">
<SummaryInformation Keywords="Installer" Description="$(var.Manufacturer)" Manufacturer="$(var.Manufacturer)" />
@ -124,19 +124,19 @@
<File Id="libxml2.dll" Source="$(var.SolutionDir)..\..\..\Bin\$(var.Platform)\Release\libxml2.dll" KeyPath="yes" Checksum="yes" ProcessorArchitecture="x64" ReadOnly="yes" />
</Component>
<Component Id="msvcp140.dll" Guid="8f1ffde7-c1bd-45fb-8bc8-26dde552eafd">
<File Id="msvcp140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.36.32532\x64\Microsoft.VC143.CRT\msvcp140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes" />
<File Id="msvcp140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.38.33130\x64\Microsoft.VC143.CRT\msvcp140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes" />
</Component>
<Component Id="vcruntime140.dll" Guid="50c9bc27-c547-4a03-9f6c-cd416f449dd8">
<File Id="vcruntime140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.36.32532\x64\Microsoft.VC143.CRT\vcruntime140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes" />
<File Id="vcruntime140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.38.33130\x64\Microsoft.VC143.CRT\vcruntime140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes" />
</Component>
<Component Id="vcruntime140_1.dll" Guid="a02507f8-326b-45b2-b734-e5091921559f">
<File Id="vcruntime140_1.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.36.32532\x64\Microsoft.VC143.CRT\vcruntime140_1.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes" />
<File Id="vcruntime140_1.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.38.33130\x64\Microsoft.VC143.CRT\vcruntime140_1.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes" />
</Component>
<Component Id="vccorlib140.dll" Guid="affe33e7-1e64-4bb0-a062-2b56f77459b4">
<File Id="vccorlib140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.36.32532\x64\Microsoft.VC143.CRT\vccorlib140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes" />
<File Id="vccorlib140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.38.33130\x64\Microsoft.VC143.CRT\vccorlib140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes" />
</Component>
<Component Id="concrt140.dll" Guid="7fb716a1-1b4f-42fb-89c7-4d216ebd6e2e">
<File Id="concrt140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.36.32532\x64\Microsoft.VC143.CRT\concrt140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes" />
<File Id="concrt140.dll" Source="$(var.DevEnvDir)..\..\VC\Redist\MSVC\14.38.33130\x64\Microsoft.VC143.CRT\concrt140.dll" KeyPath="yes" Checksum="yes" ReadOnly="yes" />
</Component>
<Component Id="flam3palettes.xml" Guid="d3adb0bb-14ef-4923-99d9-a5784b7ef04e">
<File Id="flam3palettes.xml" Source="$(var.SolutionDir)..\..\..\Data\flam3-palettes.xml" KeyPath="yes" Checksum="yes" ReadOnly="yes" />

Binary file not shown.

View File

@ -49,8 +49,8 @@
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 23, 23, 8, 100
PRODUCTVERSION 23, 23, 8, 100
FILEVERSION 23, 23, 8, 101
PRODUCTVERSION 23, 23, 8, 101
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -67,12 +67,12 @@
BEGIN
VALUE "CompanyName", "Open Source"
VALUE "FileDescription", "Renders fractal flames as animations with motion blur"
VALUE "FileVersion", "23, 23, 8, 100"
VALUE "FileVersion", "23, 23, 8, 101"
VALUE "InternalName", "EmberAnimate.exe"
VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2021, GPL v3"
VALUE "OriginalFilename", "EmberAnimate.exe"
VALUE "ProductName", "Ember Animate"
VALUE "ProductVersion", "23, 23, 8, 100"
VALUE "ProductVersion", "23, 23, 8, 101"
END
END
BLOCK "VarFileInfo"

Binary file not shown.

View File

@ -49,8 +49,8 @@
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 23, 23, 8, 100
PRODUCTVERSION 23, 23, 8, 100
FILEVERSION 23, 23, 8, 101
PRODUCTVERSION 23, 23, 8, 101
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -67,12 +67,12 @@
BEGIN
VALUE "CompanyName", "Open Source"
VALUE "FileDescription", "Manipulates fractal flame parameter files"
VALUE "FileVersion", "23, 23, 8, 100"
VALUE "FileVersion", "23, 23, 8, 101"
VALUE "InternalName", "EmberGenome.exe"
VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2021, GPL v3"
VALUE "OriginalFilename", "EmberGenome.exe"
VALUE "ProductName", "Ember Genome"
VALUE "ProductVersion", "23, 23, 8, 100"
VALUE "ProductVersion", "23, 23, 8, 101"
END
END
BLOCK "VarFileInfo"

View File

@ -49,8 +49,8 @@
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 23, 23, 8, 100
PRODUCTVERSION 23, 23, 8, 100
FILEVERSION 23, 23, 8, 101
PRODUCTVERSION 23, 23, 8, 101
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -67,12 +67,12 @@
BEGIN
VALUE "CompanyName", "Open Source"
VALUE "FileDescription", "Renders fractal flames as single images"
VALUE "FileVersion", "23, 23, 8, 100"
VALUE "FileVersion", "23, 23, 8, 101"
VALUE "InternalName", "EmberRender.exe"
VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2021, GPL v3"
VALUE "OriginalFilename", "EmberRender.exe"
VALUE "ProductName", "Ember Render"
VALUE "ProductVersion", "23, 23, 8, 100"
VALUE "ProductVersion", "23, 23, 8, 101"
END
END
BLOCK "VarFileInfo"

Binary file not shown.

View File

@ -1,4 +1,4 @@
23.23.8.100 8/6/2023
23.23.8.1 8/6/2023
--User changes
-Add Clear Sequence button to the Sequence Panel.

View File

@ -37,7 +37,7 @@ static void sincos(float x, float* s, float* c)
namespace EmberNs
{
#define EMBER_VERSION "23.23.8.100"
#define EMBER_VERSION "23.23.8.101"
//#define FLAM3_COMPAT 1//Uncomment this if you want full compatibility with flam3 regarding some of the trig-based variations in Variations01.h
#define EPS6 T(1e-6)
#define EPS std::numeric_limits<T>::epsilon()//Apoplugin.h uses -20, but it's more mathematically correct to do it this way.

View File

@ -531,6 +531,10 @@ bool RendererBase::Shared() const { return false; }
void RendererBase::Reset()
{
Abort();
while (InRender())
std::this_thread::sleep_for(std::chrono::milliseconds(10));
EnterRender();
EnterFinalAccum();
LeaveFinalAccum();

View File

@ -61,7 +61,7 @@
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Fractorium 23.23.8.100&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;http://fractorium.com&quot;&gt;&lt;span style=&quot; font-size:10pt; text-decoration: underline; color:#0000ff;&quot;&gt;fractorium.com&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Fractorium 23.23.8.101&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;http://fractorium.com&quot;&gt;&lt;span style=&quot; font-size:10pt; text-decoration: underline; color:#0000ff;&quot;&gt;fractorium.com&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>

View File

@ -40,15 +40,7 @@ void FinalRenderEmberController<T>::CancelRender()
if (m_Renderer.get())
{
m_Renderer->Abort();
while (m_Renderer->InRender())
std::this_thread::sleep_for(std::chrono::milliseconds(10));
m_Renderer->EnterRender();
m_Renderer->EnterFinalAccum();
m_Renderer->LeaveFinalAccum();
m_Renderer->LeaveRender();
m_Renderer->Reset();
}
else
{

View File

@ -177,7 +177,7 @@ public:
using PreviewRenderer<T>::m_PreviewRenderer;
using PreviewRenderer<T>::m_PreviewFinalImage;
FinalRenderPreviewRenderer(FinalRenderEmberController<T>* controller) : m_Controller(controller)
FinalRenderPreviewRenderer(FinalRenderEmberController<T>* controller) : m_Controller(controller), PreviewRenderer<T>(nullptr)
{
}

View File

@ -6264,8 +6264,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>269</width>
<height>650</height>
<width>144</width>
<height>58</height>
</rect>
</property>
<property name="sizePolicy">
@ -8074,6 +8074,13 @@
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QProgressBar" name="SequenceProgressBar">
<property name="value">
<number>0</number>
</property>
</widget>
</item>
</layout>
</item>
<item>

View File

@ -68,8 +68,8 @@ FractoriumEmberController<T>::FractoriumEmberController(Fractorium* fractorium)
{
size_t b = 0;
m_GLController = make_unique<GLEmberController<T>>(fractorium, fractorium->ui.GLDisplay, this);
m_LibraryPreviewRenderer = make_unique<TreePreviewRenderer<T>>(this, m_Fractorium->ui.LibraryTree, m_EmberFile);
m_SequencePreviewRenderer = make_unique<TreePreviewRenderer<T>>(this, m_Fractorium->ui.SequenceTree, m_SequenceFile);
m_LibraryPreviewRenderer = make_unique<TreePreviewRenderer<T>>(this, m_Fractorium->ui.LibraryTree, m_EmberFile, nullptr);
m_SequencePreviewRenderer = make_unique<TreePreviewRenderer<T>>(this, m_Fractorium->ui.SequenceTree, m_SequenceFile, m_Fractorium->ui.SequenceProgressBar);
m_PaletteList->Clear();
m_Fractorium->ui.PaletteFilenameCombo->clear();
//Initial combo change event to fill the palette table will be called automatically later.
@ -397,6 +397,12 @@ void TreePreviewRenderer<T>::PreviewRenderFunc(uint start, uint end)
if (const auto top = m_Tree->topLevelItem(m_Tree->topLevelItemCount() - 1))
{
size_t i = start;
double prc = 0;
double ct = 0;
double total = end - start;
if (m_Pb)
QMetaObject::invokeMethod(m_Pb, "setValue", Qt::QueuedConnection, Q_ARG(const int, 0));
for (auto b = Advance(m_EmberFile.m_Embers.begin(), start); m_PreviewRun && i < end && b != m_EmberFile.m_Embers.end(); ++b, ++i)
{
@ -422,11 +428,19 @@ void TreePreviewRenderer<T>::PreviewRenderFunc(uint start, uint end)
Q_ARG(vv4F&, m_PreviewFinalImage),
Q_ARG(uint, PREVIEW_SIZE),
Q_ARG(uint, PREVIEW_SIZE));
prc = 100.0 * (++ct / total);
if (m_Pb)
QMetaObject::invokeMethod(m_Pb, "setValue", Qt::QueuedConnection, Q_ARG(const int, int(prc)));
treeItem->SetRendered();
}
}
}
}
if (m_Pb)
QMetaObject::invokeMethod(m_Pb, "setValue", Qt::QueuedConnection, Q_ARG(const int, 100));
}
}

View File

@ -646,8 +646,9 @@ template <typename T>
class PreviewRenderer
{
public:
PreviewRenderer()
PreviewRenderer(QProgressBar* p)
{
m_Pb = p;
}
virtual ~PreviewRenderer()
@ -669,8 +670,10 @@ public:
void Stop()
{
m_PreviewRun = false;
m_PreviewRenderer.Abort();
m_PreviewResult.waitForFinished();
m_PreviewRenderer.Reset();
while (m_PreviewResult.isRunning())
QApplication::processEvents();
}
bool EarlyClip()
@ -696,6 +699,7 @@ protected:
vector<unsigned char> m_PreviewVec;
vv4F m_PreviewFinalImage;
EmberNs::Renderer<T, float> m_PreviewRenderer;
QProgressBar* m_Pb = nullptr;
private:
QFuture<void> m_PreviewResult;
@ -714,6 +718,7 @@ public:
using PreviewRenderer<T>::m_PreviewVec;
using PreviewRenderer<T>::m_PreviewRenderer;
using PreviewRenderer<T>::m_PreviewFinalImage;
using PreviewRenderer<T>::m_Pb;
/// <summary>
/// Initializes a new instance of the <see cref="TreePreviewRenderer{T}"/> class.
@ -721,10 +726,11 @@ public:
/// <param name="controller">A pointer to the controller this instance is a member of</param>
/// <param name="tree">A pointer to the tree to render to</param>
/// <param name="emberFile">A reference to the ember file to render</param>
TreePreviewRenderer(FractoriumEmberController<T>* controller, QTreeWidget* tree, EmberFile<T>& emberFile) :
TreePreviewRenderer(FractoriumEmberController<T>* controller, QTreeWidget* tree, EmberFile<T>& emberFile, QProgressBar* p) :
m_Controller(controller),
m_Tree(tree),
m_EmberFile(emberFile)
m_EmberFile(emberFile),
PreviewRenderer<T>(p)
{
const auto f = m_Controller->m_Fractorium;
m_PreviewRenderer.Callback(nullptr);

View File

@ -465,7 +465,11 @@ void FractoriumEmberController<T>::RenderLibraryPreviews(uint start, uint end)
}
template <typename T>
void FractoriumEmberController<T>::StopLibraryPreviewRender() { m_LibraryPreviewRenderer->Stop(); }
void FractoriumEmberController<T>::StopLibraryPreviewRender()
{
m_LibraryPreviewRenderer->Stop();
QApplication::processEvents();
}
/// <summary>
/// Thing wrapper around StopLibraryPreviewRender() and StopSequencePreviewRender() to stop both preview renderers.
@ -571,17 +575,18 @@ void FractoriumEmberController<T>::RenderSequencePreviews(uint start, uint end)
RenderPreviews(m_Fractorium->ui.SequenceTree, m_SequencePreviewRenderer.get(), m_SequenceFile, start, end);
}
void Fractorium::OnSequenceStartPreviewsButtonClicked(bool checked)
{
m_Controller->RenderSequencePreviews();
}
void Fractorium::OnSequenceStartPreviewsButtonClicked(bool checked) { m_Controller->RenderSequencePreviews(); }
/// <summary>
/// Stop rendering the sequence previews.
/// Called when Stop Previews is clicked.
/// </summary>
template <typename T>
void FractoriumEmberController<T>::StopSequencePreviewRender() { m_SequencePreviewRenderer->Stop(); }
void FractoriumEmberController<T>::StopSequencePreviewRender()
{
m_SequencePreviewRenderer->Stop();
QApplication::processEvents();
}
void Fractorium::OnSequenceStopPreviewsButtonClicked(bool checked) { m_Controller->StopSequencePreviewRender(); }
/// <summary>

View File

@ -290,13 +290,13 @@ void FractoriumEmberController<T>::OpenAndPrepFiles(const QStringList& filenames
{
if (!filenames.empty())
{
StopAllPreviewRenderers();
size_t i;
EmberFile<T> emberFile;
XmlToEmber<T> parser;
vector<Ember<T>> embers;
vector<string> errors;
uint previousSize = append ? uint(m_EmberFile.Size()) : 0u;
StopAllPreviewRenderers();
emberFile.m_Filename = filenames[0];
for (auto& filename : filenames)

View File

@ -641,7 +641,7 @@ bool FractoriumEmberController<T>::CreateRenderer(eRendererType renderType, cons
if (updatePreviews)
{
m_LibraryPreviewRenderer = make_unique<TreePreviewRenderer<T>>(this, m_Fractorium->ui.LibraryTree, m_EmberFile);//Will take the same settings as the main renderer.
m_LibraryPreviewRenderer = make_unique<TreePreviewRenderer<T>>(this, m_Fractorium->ui.LibraryTree, m_EmberFile, nullptr);//Will take the same settings as the main renderer.
RenderLibraryPreviews();
}