- fix a bunch of msvc warnings (mostly assigning double constants to float variables)
[supertux.git] / src / title.cpp
index 4b4d62a..569ebfd 100644 (file)
@@ -154,7 +154,8 @@ TitleScreen::get_level_name(const std::string& filename)
     level->get("name", name);
     return name;
   } catch(std::exception& e) {
-    log_warning << "Problem getting name of '" << filename << "'." << std::endl;
+         log_warning << "Problem getting name of '" << filename << "': "
+                  << e.what() << std::endl;
     return "";
   }
 }
@@ -233,7 +234,7 @@ TitleScreen::make_tux_jump()
   // Check if we should press the jump button
   bool randomJump = !randomWaitTimer.started();
   bool notMoving = (fabsf(dx) + fabsf(dy)) < 0.1;
-  bool pathBlocked = !sector->is_free_space(lookahead);
+  bool pathBlocked = !sector->is_free_of_statics(lookahead);
   if (!controller->released(Controller::JUMP)
       && (notMoving || pathBlocked || randomJump)) {
     float jumpDuration;
@@ -267,9 +268,10 @@ TitleScreen::TitleScreen()
 
   Player* player = titlesession->get_current_sector()->player;
   player->set_controller(controller.get());
+  player->set_speedlimit(230); //MAX_WALK_XM
 
   main_menu.reset(new Menu());
-  main_menu->set_pos(SCREEN_WIDTH/2, 335);
+  main_menu->set_pos(SCREEN_WIDTH/2, SCREEN_HEIGHT/2 + 35);
   main_menu->add_entry(MNID_STARTGAME, _("Start Game"));
   main_menu->add_entry(MNID_LEVELS_CONTRIB, _("Contrib Levels"));
   main_menu->add_submenu(_("Options"), get_options_menu());
@@ -324,7 +326,7 @@ TitleScreen::draw(DrawingContext& context)
 void
 TitleScreen::update(float elapsed_time)
 {
-  main_loop->set_speed(0.6);
+  main_loop->set_speed(0.6f);
   Sector* sector  = titlesession->get_current_sector();
   sector->update(elapsed_time);
 
@@ -413,7 +415,7 @@ TitleScreen::get_slotinfo(int slot)
       throw std::runtime_error("file is not a supertux-savegame.");
 
     savegame->get("title", title);
-  } catch(std::exception& e) {
+  } catch(std::exception& ) {
     std::ostringstream slottitle;
     slottitle << _("Slot") << " " << slot << " - " << _("Free");
     return slottitle.str();