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

View File

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