From efa9dc072db18929ca95ab6d5c75b1ac1ac60625 Mon Sep 17 00:00:00 2001 From: Person Date: Sat, 7 Mar 2020 21:23:05 -0800 Subject: [PATCH] --Bug fixes -EmberAnimate.exe was using 1-based indexing for filenames, but Fractorium and all of the documentation was using 0-based indexing. Make all use 0-based indexing. --- Source/EmberAnimate/EmberAnimate.cpp | 10 ++++++---- Source/apoconv/Form1.cs | 20 +++++++------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Source/EmberAnimate/EmberAnimate.cpp b/Source/EmberAnimate/EmberAnimate.cpp index 004ebb2..6395cc7 100644 --- a/Source/EmberAnimate/EmberAnimate.cpp +++ b/Source/EmberAnimate/EmberAnimate.cpp @@ -190,8 +190,10 @@ bool EmberAnimate(int argc, _TCHAR* argv[], EmberOptions& opt) return false; } - opt.FirstFrame(opt.Frame()); - opt.LastFrame(opt.Frame() + 1); + if (opt.Frame()) + opt.FirstFrame(opt.Frame() - 1); + + opt.LastFrame(opt.FirstFrame() + 1); } //Prep all embers, by ensuring they: @@ -513,7 +515,7 @@ bool EmberAnimate(int argc, _TCHAR* argv[], EmberOptions& opt) if (opt.WriteGenome()) { - auto flameName = MakeAnimFilename(inputPath, opt.Prefix(), opt.Suffix(), ".flame", padding, ftime); + auto flameName = MakeAnimFilename(inputPath, opt.Prefix(), opt.Suffix(), ".flame", padding, size_t(localTime)); if (opt.Verbose()) { @@ -548,7 +550,7 @@ bool EmberAnimate(int argc, _TCHAR* argv[], EmberOptions& opt) //when running with OpenCL. Call join() to ensure the previous thread call has completed. Join(writeThread); auto threadVecIndex = finalImageIndex;//Cache before launching thread. - auto baseFilename = MakeAnimFilename(inputPath, opt.Prefix(), opt.Suffix(), "", padding, ftime); + auto baseFilename = MakeAnimFilename(inputPath, opt.Prefix(), opt.Suffix(), "", padding, size_t(localTime)); if (opt.ThreadedWrite())//Copies of all but the first parameter are passed to saveFunc(), to avoid conflicting with those values changing when starting the render for the next image. { diff --git a/Source/apoconv/Form1.cs b/Source/apoconv/Form1.cs index f1b4777..ea92eb2 100644 --- a/Source/apoconv/Form1.cs +++ b/Source/apoconv/Form1.cs @@ -46,29 +46,23 @@ namespace apoconv { "sinh(", "std::sinh(" }, { "asin(", "std::asin(" }, { "asinh(", "std::asinh(" }, - { "cos(", "std::cos(" }, { "cosh(", "std::cosh(" }, { "acos(", "std::acos(" }, { "acosh(", "std::acosh(" }, - { "tan(", "std::tan(" }, { "tanh(", "std::tanh(" }, { "atan(", "std::atan(" }, { "atan2(", "std::atan2(" }, { "atanh(", "std::atanh(" }, - { "sqrt(", "std::sqrt(" }, { "pow(", "std::pow(" }, { "fabs(", "std::abs(" }, { "abs(", "std::abs(" }, { "log(", "std::log(" }, { "exp(", "std::exp(" }, - { "sqr(", "Sqr(" }, - { "random01()", "rand.Frand01()" }, - { "M_E", "T(M_E)" }, { "M_LOG2E", "T(M_LOG2E)" }, { "M_LOG10E", "T(M_LOG10E)" }, @@ -82,7 +76,6 @@ namespace apoconv { "M_2_SQRTPI", "T(M_2_SQRTPI)" }, { "M_SQRT2", "T(M_SQRT2)" }, { "M_SQRT1_2", "T(M_SQRT1_2)" }, - }; public Form1() @@ -98,7 +91,6 @@ namespace apoconv return ""; //doexport = false; - bool isparvar = false; string pluginname = ""; string varclassname = ""; @@ -107,7 +99,6 @@ namespace apoconv m_PrecalcFuncLines.Clear(); m_CalcFuncLines.Clear(); m_FinalCalcFuncLines.Clear(); - bool structstart = false; foreach (var line in lines) @@ -150,7 +141,6 @@ namespace apoconv Name = split.Trim(), MemberName = "m_" + split.RemoveFirst(pluginname + "_").FirstCharToUpper().Replace("_", "").Trim(), }); - isparvar = true; } } @@ -383,7 +373,6 @@ namespace apoconv final += "\t\thelper.Out.z = DefaultZ(helper);\r\n"; final += "\t}\r\n"; - final += "\r\n\tvirtual string OpenCLString() const override\r\n"; final += "\t{\r\n"; final += "\t ostringstream ss, ss2;\r\n"; @@ -477,7 +466,6 @@ namespace apoconv if (isparvar) { - final += "\r\nprotected:\r\n"; final += "\tvoid Init()\r\n"; final += "\t{\r\n"; @@ -539,7 +527,6 @@ namespace apoconv private void textBox1_TextChanged(object sender, EventArgs e) { textBox2.Text = Apo2Fractorium(textBox1.Lines, true); - } private void textBox1_DragDrop(object sender, DragEventArgs e) @@ -557,6 +544,13 @@ namespace apoconv var lines = File.ReadAllLines(file); tb1lines.AddRange(lines.ToList()); final += Apo2Fractorium(lines, true); + /* + var guid = Guid.NewGuid(); + var fileonly = System.IO.Path.GetFileName(file); + final += "\n"; + final += "\t\n"; + final += "\n\n"; + */ } textBox1.Lines = tb1lines.ToArray();