Some housekeeping
authorChristoph Sommer <mail@christoph-sommer.de>
Tue, 1 Jul 2008 20:11:01 +0000 (20:11 +0000)
committerChristoph Sommer <mail@christoph-sommer.de>
Tue, 1 Jul 2008 20:11:01 +0000 (20:11 +0000)
SVN-Revision: 5645

src/game_session.cpp
src/game_session.hpp
src/levelintro.cpp
src/levelintro.hpp
src/statistics.cpp
src/statistics.hpp

index 707d597..5109ea9 100644 (file)
@@ -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<Background*> (*i);
-    if(background) {
-      background->draw(context);
-    }
-    Gradient* gradient = dynamic_cast<Gradient*> (*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)
index 7350b6d..ec3fffb 100644 (file)
@@ -99,7 +99,6 @@ private:
   void process_events();
   void capture_demo_step();
 
-  void levelintro();
   void drawstatus(DrawingContext& context);
   void draw_pause(DrawingContext& context);
 
index 097fcee..84f92d3 100644 (file)
@@ -1,4 +1,4 @@
-//  $Id: textscroller.cpp 4981 2007-04-15 15:41:27Z sommer $
+//  $Id$
 //
 //  SuperTux -- LevelIntro screen
 //  Copyright (C) 2008 Christoph Sommer <christoph.sommer@2008.expires.deltadevelopment.de>
 #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;
-
-
 }
index 960630d..fc60287 100644 (file)
@@ -1,4 +1,4 @@
-//  $Id: textscroller.hpp 5330 2008-02-18 19:30:28Z sommer $
+//  $Id$
 //
 //  SuperTux -- LevelIntro screen
 //  Copyright (C) 2008 Christoph Sommer <christoph.sommer@2008.expires.deltadevelopment.de>
index 4298fc9..9f9191e 100644 (file)
@@ -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
index 38c4f3e..1fe6460 100644 (file)
@@ -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 */