#include "log.hpp"
#include "worldmap/worldmap.hpp"
#include "mainloop.hpp"
+#include "player_status.hpp"
static bool has_suffix(const std::string& data, const std::string& suffix)
{
basedir = FileSystem::dirname(filename);
lisp::Parser parser;
- std::auto_ptr<lisp::Lisp> root (parser.parse(filename));
+ const lisp::Lisp* root = parser.parse(filename);
const lisp::Lisp* info = root->get_lisp("supertux-world");
if(info == NULL)
info->get("title", title);
info->get("description", description);
info->get("levelset", is_levelset);
- info->get_vector("levels", levels);
+ info->get("levels", levels);
info->get("hide-from-contribs", hide_from_contribs);
// Level info file doesn't define any levels, so read the
// directory to see what we can find
- std::string path = basedir + "/";
+ std::string path = basedir;
char** files = PHYSFS_enumerateFiles(path.c_str());
if(!files) {
log_warning << "Couldn't read subset dir '" << path << "'" << std::endl;
current_ = this;
- // create new squirrel table for persisten game state
+ // create new squirrel table for persistent game state
HSQUIRRELVM vm = Scripting::global_vm;
sq_pushroottable(vm);
sq_release(global_vm, &world_thread);
world_thread = create_thread(global_vm);
compile_and_run(object_to_vm(world_thread), in, filename);
- } catch(std::exception& e) {
+ } catch(std::exception& ) {
// fallback: try to load worldmap worldmap.stwm
using namespace WorldMapNS;
main_loop->push_screen(new WorldMap(basedir + "worldmap.stwm"));
lisp::Writer writer(savegame_filename);
writer.start_list("supertux-savegame");
- writer.write_int("version", 1);
+ writer.write("version", 1);
using namespace WorldMapNS;
if(WorldMap::current() != NULL) {
title << WorldMap::current()->get_title();
title << " (" << WorldMap::current()->solved_level_count()
<< "/" << WorldMap::current()->level_count() << ")";
- writer.write_string("title", title.str());
+ writer.write("title", title.str());
}
writer.start_list("tux");
try {
lisp::Parser parser;
- std::auto_ptr<lisp::Lisp> root (parser.parse(savegame_filename));
+ const lisp::Lisp* root = parser.parse(savegame_filename);
const lisp::Lisp* lisp = root->get_lisp("supertux-savegame");
if(lisp == NULL)