- std::string filepath = "levels/" + filename;
- int last_slash = filepath.find_last_of('/');
- FileSystem::fcreatedir(filepath.substr(0,last_slash).c_str());
- filepath = st_dir + "/" + filepath;
- ofstream file(filepath.c_str(), ios::out);
- LispWriter* writer = new LispWriter(file);
-
- writer->write_comment("Level made using SuperTux's built-in Level Editor");
-
- writer->start_list("supertux-level");
-
- int version = 2;
- writer->write_int("version", version);
-
- writer->write_string("name", name);
- writer->write_string("author", author);
- writer->write_int("time", timelimit);
- writer->write_string("end-sequence-animation",
- end_sequence_type == FIREWORKS_ENDSEQ_ANIM ? "fireworks" : "none");
-
- for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) {
- writer->start_list("sector");
- i->second->write(*writer);
- writer->end_list("sector");
- }
+ std::string filepath = "levels/" + filename;
+ int last_slash = filepath.find_last_of('/');
+ FileSystem::fcreatedir(filepath.substr(0,last_slash).c_str());
+ filepath = st_dir + "/" + filepath;
+ ofstream file(filepath.c_str(), ios::out);
+ lisp::Writer* writer = new lisp::Writer(file);
+
+ writer->write_comment("Level made using SuperTux's built-in Level Editor");
+
+ writer->start_list("supertux-level");
+
+ int version = 2;
+ writer->write_int("version", version);
+
+ writer->write_string("name", name, true);
+ writer->write_string("author", author);
+ writer->write_int("time", timelimit);
+ writer->write_string("end-sequence-animation",
+ end_sequence_type == FIREWORKS_ENDSEQ_ANIM ? "fireworks" : "none");
+
+ for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) {
+ writer->start_list("sector");
+ i->second->write(*writer);
+ writer->end_list("sector");
+ }