summaryrefslogtreecommitdiffstats
path: root/src/Instance.cpp
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2008-04-10 14:00:05 +0200
committerneoraider <devnull@localhost>2008-04-10 14:00:05 +0200
commit2271ef709f6785b2e156ddca311c7628b7803af0 (patch)
tree30c4ffc6d714a5577bb71c0d349f8013e43e907d /src/Instance.cpp
parent3c72a44fa4592e0105af6bb9a440b0da06d0bde4 (diff)
downloadzoomedit-2271ef709f6785b2e156ddca311c7628b7803af0.tar
zoomedit-2271ef709f6785b2e156ddca311c7628b7803af0.zip
zoomedit:
* Level can load Room data from the XML tree now.
Diffstat (limited to 'src/Instance.cpp')
-rw-r--r--src/Instance.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Instance.cpp b/src/Instance.cpp
index ead9cac..c3ac17c 100644
--- a/src/Instance.cpp
+++ b/src/Instance.cpp
@@ -57,6 +57,12 @@ Instance::Instance() : window(NULL), levelXml(NULL), level(NULL) {
window->signal_hide().connect(sigc::mem_fun(this, &Instance::destroy));
+ levelXml = new xmlpp::DomParser("level.lvl");
+ xmlpp::Document *doc = levelXml->get_document();
+
+ if(doc && doc->get_root_node())
+ level = new Data::Level(doc->get_root_node());
+
window->show();
}
@@ -64,12 +70,12 @@ Instance::~Instance() {
if(window)
delete window;
- if(levelXml)
- delete levelXml;
-
if(level)
delete level;
+ if(levelXml)
+ delete levelXml;
+
instances--;
if(!instances)
Gtk::Main::quit();