--User changes

-Add a new option to EmberAnimate --ignore-existing which makes it skip rendering a frame if the files from all of the requested extensions for that frame already exist.

--Code changes
 -Migrate to VS2022 and no longer use a version specific folder for the VS solution and project files. It is now under a version agnostic folder called Solution.
This commit is contained in:
Person
2022-08-18 10:29:04 -06:00
parent a2a5479c81
commit f787c4f58a
29 changed files with 132 additions and 26 deletions

View File

@ -864,7 +864,7 @@ static vector<const Variation<T>*> FindVarsWithWithout(const vector<const Variat
/// This is useful for finding variations without certain characteristics since it's not possible
/// to query the CPU C++ code at runtime.
/// </summary>
/// <param name="stringVec">The vector of variation pointers to search</param>
/// <param name="vars">The vector of variation pointers to search</param>
/// <param name="stringVec">The vector of strings to search for</param>
/// <param name="findAll">True to find all variations which don't match any strings, false to break after the first non-match is found.</param>
/// <returns>A vector of pointers to variations whose OpenCL string did not match any string in stringVec</returns>
@ -887,6 +887,32 @@ static vector<const Variation<T>*> FindVarsWithout(const vector<const Variation<
return vec;
}
/// <summary>
/// Check whether a file exists, and optionally if it's not empty.
/// </summary>
/// <param name="filename">The full path and file name to check for</param>
/// <param name="notempty">Whether to only return true if the file is found and is not empty. Default: true.</param>
/// <returns>True if the file was found and optionally not empty, else false.</returns>
static bool FileExists(const string& filename, bool notempty = true)
{
try
{
ifstream ifs;
ifs.exceptions(ifstream::failbit);
ifs.open(filename, ios::binary | ios::ate);
if (notempty)
return ifs.tellg() > 0;//Ensure it exists and wasn't empty.
else
return true;
}
catch (...)
{
}
return false;
}
}
/// <summary>

View File

@ -69,6 +69,7 @@ enum class eOptionIDs : et
OPT_LOCK_ACCUM,
OPT_DUMP_KERNEL,
OPT_FLAM3_COMPAT,
OPT_IGNORE_EXISTING,
//Value args.
OPT_NTHREADS,//Int value args.
@ -376,6 +377,7 @@ public:
INITBOOLOPTION(LockAccum, Eob(eOptionUse::OPT_USE_ALL, eOptionIDs::OPT_LOCK_ACCUM, _T("--lock_accum"), false, SO_NONE, " --lock_accum Lock threads when accumulating to the histogram using the CPU. This will drop performance to that of single threading [default: false].\n"));
INITBOOLOPTION(DumpKernel, Eob(eOptionUse::OPT_USE_RENDER, eOptionIDs::OPT_DUMP_KERNEL, _T("--dump_kernel"), false, SO_NONE, " --dump_kernel Print the iteration kernel string when using OpenCL (ignored for CPU) [default: false].\n"));
INITBOOLOPTION(Flam3Compat, Eob(eOptionUse::OPT_USE_ALL, eOptionIDs::OPT_FLAM3_COMPAT, _T("--flam3_compat"), false, SO_NONE, " --flam3_compat The behavior of the cos, cosh, cot, coth, csc, csch, sec, sech, sin, sinh, tan and tanh variations are different in flam3/Apophysis versus Chaotica. True for flam3/Apophysis behavior, false for Chaotica behavior [default: true].\n"));
INITBOOLOPTION(IgnoreExisting, Eob(eOptionUse::OPT_USE_ANIMATE, eOptionIDs::OPT_IGNORE_EXISTING, _T("--ignore-existing"), false, SO_NONE, " --ignore-existing Skip animating a frame if the output images for all of the specified file output types already exist in the output folder [default: false].\n"));
//Int.
INITINTOPTION(Symmetry, Eoi(eOptionUse::OPT_USE_GENOME, eOptionIDs::OPT_SYMMETRY, _T("--symmetry"), 0, SO_REQ_SEP, " --symmetry=<val> Set symmetry of result [default: 0].\n"));
INITINTOPTION(SheepGen, Eoi(eOptionUse::OPT_USE_GENOME, eOptionIDs::OPT_SHEEP_GEN, _T("--sheep_gen"), -1, SO_REQ_SEP, " --sheep_gen=<val> Sheep generation of this flame [default: -1].\n"));
@ -538,6 +540,7 @@ public:
PARSEBOOLOPTION(eOptionIDs::OPT_LOCK_ACCUM, LockAccum);
PARSEBOOLOPTION(eOptionIDs::OPT_DUMP_KERNEL, DumpKernel);
PARSEBOOLOPTION(eOptionIDs::OPT_FLAM3_COMPAT, Flam3Compat);
PARSEBOOLOPTION(eOptionIDs::OPT_IGNORE_EXISTING, IgnoreExisting);
PARSEOPTION(eOptionIDs::OPT_SYMMETRY, Symmetry);//Int args
PARSEOPTION(eOptionIDs::OPT_SHEEP_GEN, SheepGen);
PARSEOPTION(eOptionIDs::OPT_SHEEP_ID, SheepId);
@ -829,6 +832,7 @@ public:
Eob LockAccum;
Eob DumpKernel;
Eob Flam3Compat;
Eob IgnoreExisting;
Eoi Symmetry;//Value int.
Eoi SheepGen;