From 41b1a29c10b9c5e799d57356eee0d1701c3828b4 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Tue, 1 Jul 2008 20:11:01 +0000 Subject: [PATCH] Some housekeeping SVN-Revision: 5645 --- src/game_session.cpp | 41 ----------------------------------------- src/game_session.hpp | 1 - src/levelintro.cpp | 10 +--------- src/levelintro.hpp | 2 +- src/statistics.cpp | 43 ------------------------------------------- src/statistics.hpp | 1 - 6 files changed, 2 insertions(+), 96 deletions(-) diff --git a/src/game_session.cpp b/src/game_session.cpp index 707d597ad..5109ea98a 100644 --- a/src/game_session.cpp +++ b/src/game_session.cpp @@ -154,8 +154,6 @@ GameSession::restart_level() currentsector->activate("main"); } - //levelintro(); - sound_manager->stop_music(); currentsector->play_music(LEVEL_MUSIC); @@ -244,45 +242,6 @@ GameSession::play_demo(const std::string& filename) } void -GameSession::levelintro() -{ - sound_manager->stop_music(); - - DrawingContext context; - for(Sector::GameObjects::iterator i = currentsector->gameobjects.begin(); - i != currentsector->gameobjects.end(); ++i) { - Background* background = dynamic_cast (*i); - if(background) { - background->draw(context); - } - Gradient* gradient = dynamic_cast (*i); - if(gradient) { - gradient->draw(context); - } - } - -// context.draw_text(gold_text, level->get_name(), Vector(SCREEN_WIDTH/2, 160), -// ALIGN_CENTER, LAYER_FOREGROUND1); - context.draw_center_text(gold_text, level->get_name(), Vector(0, 160), - LAYER_FOREGROUND1); - - std::stringstream ss_coins; - ss_coins << _("Coins") << ": " << player_status->coins; - context.draw_text(white_text, ss_coins.str(), Vector(SCREEN_WIDTH/2, 210), - ALIGN_CENTER, LAYER_FOREGROUND1); - - if((level->get_author().size()) && (level->get_author() != "SuperTux Team")) - context.draw_text(white_small_text, - std::string(_("contributed by ")) + level->get_author(), - Vector(SCREEN_WIDTH/2, 350), ALIGN_CENTER, LAYER_FOREGROUND1); - - if(best_level_statistics != NULL) - best_level_statistics->draw_message_info(context, _("Best Level Statistics")); - - wait_for_event(1.0, 3.0); -} - -void GameSession::on_escape_press() { if(currentsector->player->is_dying() || end_sequence) diff --git a/src/game_session.hpp b/src/game_session.hpp index 7350b6d61..ec3fffbe3 100644 --- a/src/game_session.hpp +++ b/src/game_session.hpp @@ -99,7 +99,6 @@ private: void process_events(); void capture_demo_step(); - void levelintro(); void drawstatus(DrawingContext& context); void draw_pause(DrawingContext& context); diff --git a/src/levelintro.cpp b/src/levelintro.cpp index 097fceea9..84f92d317 100644 --- a/src/levelintro.cpp +++ b/src/levelintro.cpp @@ -1,4 +1,4 @@ -// $Id: textscroller.cpp 4981 2007-04-15 15:41:27Z sommer $ +// $Id$ // // SuperTux -- LevelIntro screen // Copyright (C) 2008 Christoph Sommer @@ -36,11 +36,6 @@ #include "random_generator.hpp" -static const float DEFAULT_SPEED = 20; -static const float LEFT_BORDER = 50; -static const float SCROLL = 60; -static const float ITEMS_SPACE = 4; - LevelIntro::LevelIntro(const Level* level, const Statistics* best_level_statistics) : level(level), best_level_statistics(best_level_statistics), player_sprite_py(0), player_sprite_vy(0) { @@ -139,7 +134,4 @@ LevelIntro::draw(DrawingContext& context) py += white_text->get_height(); } - py += 32; - - } diff --git a/src/levelintro.hpp b/src/levelintro.hpp index 960630d4d..fc6028783 100644 --- a/src/levelintro.hpp +++ b/src/levelintro.hpp @@ -1,4 +1,4 @@ -// $Id: textscroller.hpp 5330 2008-02-18 19:30:28Z sommer $ +// $Id$ // // SuperTux -- LevelIntro screen // Copyright (C) 2008 Christoph Sommer diff --git a/src/statistics.cpp b/src/statistics.cpp index 4298fc9f7..9f9191ec5 100644 --- a/src/statistics.cpp +++ b/src/statistics.cpp @@ -166,49 +166,6 @@ Statistics::draw_worldmap_info(DrawingContext& context) } void -Statistics::draw_message_info(DrawingContext& context, std::string title) -{ - // skip draw if level was never played - // TODO: do we need this? - if (coins == nv_coins) return; - - // skip draw if stats were declared invalid - if (!valid) return; - - const float width = white_small_text->get_text_width("Max coins collected: 1111 / 1111"); - const float left = (SCREEN_WIDTH - width) / 2; - const float right = (SCREEN_WIDTH + width) / 2; - - context.draw_text(gold_text, title, Vector(SCREEN_WIDTH/2, 410), ALIGN_CENTER, LAYER_GUI); - - char stat_buf[128]; - int py = 450 + 18; - - snprintf(stat_buf, sizeof(stat_buf), "%d/%d", coins, total_coins); - context.draw_text(white_small_text, _("Max coins collected:"), Vector(left, py), ALIGN_LEFT, LAYER_GUI); - context.draw_text(white_small_text, "%d / %d", Vector(right, py), ALIGN_RIGHT, LAYER_GUI); - py+=18; - - snprintf(stat_buf, sizeof(stat_buf), "%d/%d", badguys, total_badguys); - context.draw_text(white_small_text, _("Max fragging:"), Vector(left, py), ALIGN_LEFT, LAYER_GUI); - context.draw_text(white_small_text, "%d / %d", Vector(right, py), ALIGN_RIGHT, LAYER_GUI); - py+=18; - - int csecs = (int)(time * 100); - int mins = (int)(csecs / 6000); - int secs = (csecs % 6000) / 100; - snprintf(stat_buf, sizeof(stat_buf), "%02d:%02d", mins,secs); - context.draw_text(white_small_text, _("Min time needed:"), Vector(left, py), ALIGN_LEFT, LAYER_GUI); - context.draw_text(white_small_text, "%02d:%02d", Vector(right, py), ALIGN_RIGHT, LAYER_GUI); - py+=18; - - snprintf(stat_buf, sizeof(stat_buf), "%d/%d", secrets, total_secrets); - context.draw_text(white_small_text, _("Max secrets found:"), Vector(left, py), ALIGN_LEFT, LAYER_GUI); - context.draw_text(white_small_text, "%d / %d", Vector(right, py), ALIGN_RIGHT, LAYER_GUI); - py+=18; -} - -void Statistics::draw_endseq_panel(DrawingContext& context, Statistics* best_stats, Surface* backdrop) { // skip draw if level was never played diff --git a/src/statistics.hpp b/src/statistics.hpp index 38c4f3e24..1fe64604e 100644 --- a/src/statistics.hpp +++ b/src/statistics.hpp @@ -63,7 +63,6 @@ public: void unserialize_from_squirrel(HSQUIRRELVM vm); void draw_worldmap_info(DrawingContext& context); /**< draw worldmap stat HUD */ - void draw_message_info(DrawingContext& context, std::string title); /**< draw stats at level start */ void draw_endseq_panel(DrawingContext& context, Statistics* best_stats, Surface* backdrop); /**< draw panel shown during level's end sequence */ void zero(); /**< Set stats to zero */ -- 2.11.0