+ main_loop->push_screen(new TextScroller(filename));
+}
+
+void load_worldmap(const std::string& filename)
+{
+ using namespace WorldMapNS;
+
+ std::auto_ptr<WorldMap> worldmap(new WorldMap());
+ worldmap->loadmap(filename);
+ main_loop->push_screen(worldmap.release());
+}
+
+void load_level(const std::string& filename)
+{
+ main_loop->push_screen(new GameSession(filename, ST_GL_PLAY));
+}
+
+static SQInteger squirrel_read_char(SQUserPointer file)
+{
+ std::istream* in = reinterpret_cast<std::istream*> (file);
+ char c = in->get();
+ if(in->eof())
+ return 0;
+
+ return c;
+}
+
+
+void import(HSQUIRRELVM vm, const std::string& filename)
+{
+ IFileStream in(filename);
+
+ if(SQ_FAILED(sq_compile(vm, squirrel_read_char, &in,
+ filename.c_str(), SQTrue)))
+ throw SquirrelError(vm, "Couldn't parse script");
+
+ sq_pushroottable(vm);
+ if(SQ_FAILED(sq_call(vm, 1, SQFalse))) {
+ sq_pop(vm, 1);
+ throw SquirrelError(vm, "Couldn't execute script");
+ }
+ sq_pop(vm, 1);
+}
+
+void add_key(int new_key)
+{
+ player_status->set_keys(new_key);
+}
+
+void debug_collrects(bool enable)
+{
+ Sector::show_collrects = enable;
+}
+
+void save_state()
+{
+ if(World::current() == NULL)
+ throw std::runtime_error("Can't save state without active World");
+
+ World::current()->save_state();