From 7fa8e4b4faf6dca308607977d2c2aaa5428ca60d Mon Sep 17 00:00:00 2001 From: neoraider Date: Sat, 12 Apr 2008 19:06:05 +0000 Subject: zoomedit: * Made Rooms, Gates and Textures in Levels changable --- src/Instance.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Instance.cpp') 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 #include +#include #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); -- cgit v1.2.3