- if(config->show_fps) {
- char str[60];
- snprintf(str, sizeof(str), "%2.1f", fps_fps);
- context.draw_text(white_text, "FPS",
- Vector(SCREEN_WIDTH -
- white_text->get_text_width("FPS ") - BORDER_X, BORDER_Y + 40),
- LEFT_ALLIGN, LAYER_FOREGROUND1);
- context.draw_text(gold_text, str,
- Vector(SCREEN_WIDTH-4*16 - BORDER_X, BORDER_Y + 40),
- LEFT_ALLIGN, LAYER_FOREGROUND1);
- }
-}
-
-void
-GameSession::drawresultscreen()
-{
- char str[80];
-
- DrawingContext context;
- for(Sector::GameObjects::iterator i = currentsector->gameobjects.begin();
- i != currentsector->gameobjects.end(); ++i) {
- Background* background = dynamic_cast<Background*> (*i);
- if(background) {
- background->draw(context);
- }
- }
-
- context.draw_text(blue_text, _("Result:"), Vector(SCREEN_WIDTH/2, 200),
- CENTER_ALLIGN, LAYER_FOREGROUND1);
-
- sprintf(str, _("SCORE: %d"), global_stats.get_points(SCORE_STAT));
- context.draw_text(gold_text, str, Vector(SCREEN_WIDTH/2, 224), CENTER_ALLIGN, LAYER_FOREGROUND1);
-
- sprintf(str, _("COINS: %d"), player_status->coins);
- context.draw_text(gold_text, str, Vector(SCREEN_WIDTH/2, 256), CENTER_ALLIGN, LAYER_FOREGROUND1);
-
- context.do_drawing();
-
- wait_for_event(2.0, 5.0);
-}
-
-std::string slotinfo(int slot)
-{
- std::string tmp;
- std::string slotfile;
- std::string title;
- std::stringstream stream;
- stream << slot;
- slotfile = "save/slot" + stream.str() + ".stsg";
-
- try {
- lisp::Parser parser;
- std::auto_ptr<lisp::Lisp> root (parser.parse(slotfile));
-
- const lisp::Lisp* savegame = root->get_lisp("supertux-savegame");
- if(!savegame)
- throw std::runtime_error("file is not a supertux-savegame.");
-
- savegame->get("title", title);
- } catch(std::exception& e) {
- return std::string(_("Slot")) + " " + stream.str() + " - " +
- std::string(_("Free"));