summaryrefslogtreecommitdiffstats
path: root/src/Instance.cpp
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2008-04-12 21:06:05 +0200
committerneoraider <devnull@localhost>2008-04-12 21:06:05 +0200
commit7fa8e4b4faf6dca308607977d2c2aaa5428ca60d (patch)
tree8cbe7a0068ab0f73a7c6f3640d34c3cc11601edb /src/Instance.cpp
parent0c6471da931839b4e934d87df27ef208c74355c3 (diff)
downloadzoomedit-7fa8e4b4faf6dca308607977d2c2aaa5428ca60d.tar
zoomedit-7fa8e4b4faf6dca308607977d2c2aaa5428ca60d.zip
zoomedit:
* Made Rooms, Gates and Textures in Levels changable
Diffstat (limited to 'src/Instance.cpp')
-rw-r--r--src/Instance.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Instance.cpp b/src/Instance.cpp
index fe4b761..f602bbf 100644
--- a/src/Instance.cpp
+++ b/src/Instance.cpp
@@ -19,6 +19,7 @@
#include <iostream>
#include <libxml++/validators/dtdvalidator.h>
+#include <libxml/tree.h>
#include "Instance.h"
#include "Gui/Window.h"
#include "Data/Level.h"
@@ -91,6 +92,8 @@ void Instance::createLevel() {
levelXml = new xmlpp::DomParser;
xmlpp::Document *doc = levelXml->get_document();
+ xmlSetDocCompressMode(doc->cobj(), 9);
+
xmlpp::Element *root = doc->create_root_node("level");
xmlpp::Element *info = root->add_child("info");
@@ -131,6 +134,14 @@ bool Instance::loadLevel(const Glib::ustring &file) {
return (level != NULL);
}
+bool Instance::saveLevel(const Glib::ustring &file) {
+ if(!level | !levelXml->get_document())
+ return false;
+
+ levelXml->get_document()->write_to_file(file);
+ return true;
+}
+
bool Instance::create(const Glib::ustring &file) {
Instance *instance = new Instance(file);