--User changes

Implement copying and pasting xforms between flames.

--Code changes
 Make palette filename be a shared_ptr<string> to avoid duplication.
 Ensure random seeds in RendererCL have no duplicates and are not zero.
This commit is contained in:
mfeemster
2015-05-19 19:31:33 -07:00
parent 48ccce69f6
commit cb54605878
9 changed files with 106 additions and 8 deletions

View File

@ -51,11 +51,12 @@ public:
if (doc != nullptr)
{
xmlNode* rootNode = xmlDocGetRootElement(doc);
auto rootNode = xmlDocGetRootElement(doc);
auto pfilename = shared_ptr<string>(new string(filename));
palettes.clear();
palettes.reserve(buf.size() / 2048);//Roughly what it takes per palette.
ParsePalettes(rootNode, filename, palettes);
ParsePalettes(rootNode, pfilename, palettes);
xmlFreeDoc(doc);
added = true;
}
@ -226,7 +227,7 @@ private:
/// <param name="node">The parent note of all palettes in the Xml file.</param>
/// <param name="filename">The name of the Xml file.</param>
/// <param name="palettes">The vector to store the paresed palettes associated with this file in.</param>
void ParsePalettes(xmlNode* node, const string& filename, vector<Palette<T>>& palettes)
void ParsePalettes(xmlNode* node, const shared_ptr<string>& filename, vector<Palette<T>>& palettes)
{
bool hexError = false;
char* val;