--User changes

-Allow for pausing and resuming of final renders.

--Code changes
 -Only instantiate float version of Palette and PaletteList, no need for double since it's never used.
 -Allow for FinalRenderDialog to be queried on whether it's currently rendering.
This commit is contained in:
Person
2018-03-30 09:56:24 -07:00
parent cd1749fe5f
commit ae7b1f3ba8
11 changed files with 137 additions and 5 deletions

View File

@ -62,8 +62,6 @@ uint Timing::m_ProcessorCount;
template<> vector<pair<pair<string, string>, vector<string>>> XmlToEmber<T>::m_BadVariationNames = vector<pair<pair<string, string>, vector<string>>>(); \
template EMBER_API class Point<T>; \
template EMBER_API struct Color<T>; \
template EMBER_API class Palette<T>; \
template EMBER_API class PaletteList<T>; \
template EMBER_API class Iterator<T>; \
template EMBER_API class StandardIterator<T>; \
template EMBER_API class XaosIterator<T>; \
@ -457,6 +455,10 @@ uint Timing::m_ProcessorCount;
EXPORT_SINGLE_TYPE_EMBER(float)
EXPORT_TWO_TYPE_EMBER(float, float)
//Only ever use float palettes.
template EMBER_API class Palette<float>;
template EMBER_API class PaletteList<float>;
#ifdef DO_DOUBLE
EXPORT_SINGLE_TYPE_EMBER(double)
EXPORT_TWO_TYPE_EMBER(double, float)

View File

@ -1287,6 +1287,11 @@ EmberStats Renderer<T, bucketT>::Iterate(size_t iterCount, size_t temporalSample
m_Samples[threadIndex][0].m_Y = m_Rand[threadIndex].template Frand11<T>();
m_Samples[threadIndex][0].m_Z = 0;//m_Ember.m_CamZPos;//Apo set this to 0, then made the user use special variations to kick it. It seems easier to just set it to zpos.
m_Samples[threadIndex][0].m_ColorX = m_Rand[threadIndex].template Frand01<T>();
//Check if the user wanted to suspend the process.
while (Paused())
std::this_thread::sleep_for(500ms);
//Finally, iterate.
//t.Tic();
//Iterating, loop 3.

View File

@ -541,9 +541,12 @@ void RendererBase::LeaveFinalAccum() { m_FinalAccumCs.unlock(); m_InFinalAccum =
void RendererBase::EnterResize() { m_ResizeCs.lock(); }
void RendererBase::LeaveResize() { m_ResizeCs.unlock(); }
void RendererBase::Abort() { m_Abort = true; }
void RendererBase::Abort() { m_Abort = true; Pause(false); }
bool RendererBase::Aborted() { return m_Abort; }
void RendererBase::Pause(bool pause) { m_Pause = pause; }
bool RendererBase::Paused() { return m_Pause; }
bool RendererBase::InRender() { return m_InRender; }
bool RendererBase::InFinalAccum() { return m_InFinalAccum; }

View File

@ -188,6 +188,8 @@ public:
void LeaveResize();
void Abort();
bool Aborted();
void Pause(bool pause);
bool Paused();
bool InRender();
bool InFinalAccum();
@ -203,6 +205,7 @@ protected:
bool m_ReclaimOnResize = false;
bool m_CurvesSet = false;
volatile bool m_Abort = false;
volatile bool m_Pause = false;
size_t m_SuperRasW;
size_t m_SuperRasH;
size_t m_SuperSize = 0;