Objects now clear on load.

This commit is contained in:
MusicalProgrammer
2018-10-30 19:19:30 -04:00
parent 08a3f9f307
commit 5a20b4aefc
2 changed files with 5 additions and 3 deletions

View File

@@ -228,11 +228,13 @@ bool DataModelInstance::scanXMLObject(xml_node<> * scanNode)
return true;
}
bool DataModelInstance::load(const char* filename)
bool DataModelInstance::load(const char* filename, bool clearObjects)
{
ifstream levelFile(filename,ios::binary);
if (levelFile)
{
if (clearObjects)
clearLevel();
readXMLFileStream(&levelFile);
return true;
}
@@ -290,7 +292,7 @@ bool DataModelInstance::getOpen()
if (file)
{
_loadedFileName = of.lpstrFile;
load(of.lpstrFile);
load(of.lpstrFile,true);
}
return true;
}

View File

@@ -15,7 +15,7 @@ public:
void clearMessage();
bool debugGetOpen();
bool getOpen();
bool load(const char* filename);
bool load(const char* filename,bool clearObjects);
bool readXMLFileStream(std::ifstream* file);
void drawMessage(RenderDevice*);
WorkspaceInstance* getWorkspace();