Objects now clear on load.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user