--User changes

-Add Ctrl+g shortcut for generating a sequence.

--Bug fixes
 -Fix indendation for variations because of type icon.
 -Fix bug when duplicating flame where the new flame wasn't being properly selected.
 -Fix bug where clearing a flame was changing size and quality when it shouldn't have.
 -Fix bug where reading an Xml palette was failing on linux.

--Code changes
 -No longer pad string with null terminator in ReadFile() because std::string already does it.
This commit is contained in:
Person
2024-05-08 07:31:55 -06:00
parent 45d936b60c
commit 4c0f03a52a
10 changed files with 58 additions and 33 deletions

View File

@ -1479,7 +1479,7 @@ public:
m_BlurCurve = 0;
m_BlurCoef = 0;
m_CamMat = m3T(0);
m_Quality = 1;
m_Quality = 30;
m_SubBatchSize = 10240;
m_RandPointRange = 1;
m_FuseCount = 15;

View File

@ -208,6 +208,7 @@ bool PaletteList<T>::Add(const string& filename, bool force)
if (EndsWith(lower, ".xml"))
{
//Subtract 1 to make reading with nullterminate set to true work on linux.
const auto doc = xmlReadMemory(static_cast<const char*>(buf.data()), static_cast<int>(buf.size()), filename.c_str(), nullptr, XML_PARSE_NONET);
if (doc)

View File

@ -320,9 +320,8 @@ public:
/// </summary>
/// <param name="filename">The full path to the file to read</param>
/// <param name="buf">The string which will be populated with the file's contents</param>
/// <param name="nullTerminate">Whether to append a NULL character as the last element of the vector. Needed when reading text files. Default: true.</param>
/// <returns>True if successfully read and populated, else false</returns>
static bool ReadFile(const char* filename, string& buf, bool nullTerminate = true)
static bool ReadFile(const char* filename, string& buf)
{
try
{
@ -332,13 +331,9 @@ static bool ReadFile(const char* filename, string& buf, bool nullTerminate = tru
if (const auto pos = ifs.tellg())//Ensure it exists and wasn't empty.
{
buf.resize(pos);// +streampos(nullTerminate ? 1 : 0));
buf.resize(pos);
ifs.seekg(0, ios::beg);
ifs.read(&buf[0], pos);
if (nullTerminate && (buf[buf.size() - 1] != 0))//Optionally NULL terminate if they want to treat it as a string, and it's not terminated arleady.
buf.push_back(0);
return true;
}
}