From 2271ef709f6785b2e156ddca311c7628b7803af0 Mon Sep 17 00:00:00 2001 From: neoraider Date: Thu, 10 Apr 2008 12:00:05 +0000 Subject: zoomedit: * Level can load Room data from the XML tree now. --- src/Instance.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/Instance.cpp') 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(); -- cgit v1.2.3