Made code -Wshadow clean, missed a bunch of issues in the last commit
[supertux.git] / src / worldmap / tux.cpp
index 85c4e78..95c1c3d 100644 (file)
@@ -1,5 +1,5 @@
 //  SuperTux -  A Jump'n Run
-//  Copyright (C) 2004 Ingo Ruhnke <grumbel@gmx.de>
+//  Copyright (C) 2004 Ingo Ruhnke <grumbel@gmail.com>
 //  Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
 //
 //  This program is free software: you can redistribute it and/or modify
 //  You should have received a copy of the GNU General Public License
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-#include "control/joystickkeyboardcontroller.hpp"
+#include "control/input_manager.hpp"
 #include "scripting/squirrel_util.hpp"
 #include "sprite/sprite.hpp"
 #include "sprite/sprite_manager.hpp"
 #include "supertux/globals.hpp"
 #include "supertux/player_status.hpp"
+#include "supertux/savegame.hpp"
 #include "supertux/tile.hpp"
 #include "worldmap/level.hpp"
 #include "worldmap/tux.hpp"
@@ -59,7 +60,7 @@ Tux::~Tux()
 void
 Tux::draw(DrawingContext& context)
 {
-  switch (worldmap->get_player_status()->bonus) {
+  switch (worldmap->get_savegame().get_player_status()->bonus) {
     case GROWUP_BONUS:
       sprite->set_action(moving ? "large-walking" : "large-stop");
       break;
@@ -164,7 +165,7 @@ Tux::tryStartWalking()
 bool
 Tux::canWalk(int tile_data, Direction dir)
 {
-  return ghost_mode || 
+  return ghost_mode ||
     ((tile_data & Tile::WORLDMAP_NORTH && dir == D_NORTH) ||
      (tile_data & Tile::WORLDMAP_SOUTH && dir == D_SOUTH) ||
      (tile_data & Tile::WORLDMAP_EAST  && dir == D_EAST) ||
@@ -290,14 +291,14 @@ Tux::tryContinueWalking(float elapsed_time)
 void
 Tux::updateInputDirection()
 {
-  Controller* controller = g_jk_controller->get_controller();
-  if(controller->hold(Controller::UP))
+  Controller* controller_ = g_input_manager->get_controller();
+  if(controller_->hold(Controller::UP))
     input_direction = D_NORTH;
-  else if(controller->hold(Controller::DOWN))
+  else if(controller_->hold(Controller::DOWN))
     input_direction = D_SOUTH;
-  else if(controller->hold(Controller::LEFT))
+  else if(controller_->hold(Controller::LEFT))
     input_direction = D_WEST;
-  else if(controller->hold(Controller::RIGHT))
+  else if(controller_->hold(Controller::RIGHT))
     input_direction = D_EAST;
 }