Made code -Wshadow clean, missed a bunch of issues in the last commit
authorIngo Ruhnke <grumbel@gmail.com>
Sun, 17 Aug 2014 04:23:28 +0000 (06:23 +0200)
committerIngo Ruhnke <grumbel@gmail.com>
Sun, 17 Aug 2014 04:23:28 +0000 (06:23 +0200)
74 files changed:
src/addon/addon_manager.cpp
src/addon/md5.cpp
src/audio/ogg_sound_file.cpp
src/audio/sound_manager.cpp
src/audio/stream_sound_source.cpp
src/audio/stream_sound_source.hpp
src/badguy/badguy.cpp
src/badguy/bomb.cpp
src/badguy/fish.cpp
src/badguy/ghosttree.cpp
src/badguy/goldbomb.cpp
src/badguy/kugelblitz.cpp
src/badguy/mole_rock.cpp
src/badguy/mrbomb.cpp
src/badguy/skydive.cpp
src/badguy/treewillowisp.cpp
src/badguy/walking_badguy.cpp
src/badguy/willowisp.cpp
src/control/codecontroller.cpp
src/control/joystick_manager.cpp
src/object/background.cpp
src/object/bicycle_platform.cpp
src/object/bonus_block.cpp
src/object/broken_brick.cpp
src/object/bullet.cpp
src/object/camera.cpp
src/object/candle.cpp
src/object/display_effect.cpp
src/object/display_effect.hpp
src/object/floating_image.cpp
src/object/floating_image.hpp
src/object/icecrusher.cpp
src/object/infoblock.cpp
src/object/level_time.cpp
src/object/moving_sprite.cpp
src/object/path_walker.cpp
src/object/player.cpp
src/object/pneumatic_platform.cpp
src/object/powerup.cpp
src/object/sprite_particle.cpp
src/object/text_object.cpp
src/object/text_object.hpp
src/object/tilemap.cpp
src/object/wind.cpp
src/physfs/ofile_streambuf.cpp
src/scripting/camera.cpp
src/scripting/candle.cpp
src/scripting/level_time.cpp
src/scripting/platform.cpp
src/scripting/squirrel_error.cpp
src/scripting/thunderstorm.cpp
src/scripting/tilemap.cpp
src/scripting/wind.cpp
src/supertux/console.cpp
src/supertux/fadeout.cpp
src/supertux/game_session.cpp
src/supertux/info_box_line.cpp
src/supertux/levelintro.cpp
src/supertux/main.cpp
src/supertux/menu/options_menu.cpp
src/supertux/physic.cpp
src/supertux/sector.cpp
src/supertux/shrinkfade.cpp
src/supertux/tile.cpp
src/supertux/timer.cpp
src/trigger/door.cpp
src/trigger/scripttrigger.cpp
src/trigger/secretarea_trigger.cpp
src/util/ref.hpp
src/video/drawing_context.cpp
src/video/font.cpp
src/worldmap/level.cpp
src/worldmap/tux.cpp
src/worldmap/worldmap.cpp

index cf3e69a..c614ddf 100644 (file)
@@ -379,10 +379,10 @@ AddonManager::load_addons()
     // Search for infoFiles
     std::string infoFileName = "";
     char** rc2 = PHYSFS_enumerateFiles("/");
-    for(char** i = rc2; *i != 0; ++i) {
+    for(char** j = rc2; *j != 0; ++j) {
 
       // get filename of potential infoFile
-      std::string potentialInfoFileName = *i;
+      std::string potentialInfoFileName = *j;
 
       // make sure it looks like an infoFile
       static const std::string infoExt = ".nfo";
index cc5e83c..3a95f2c 100644 (file)
@@ -89,33 +89,33 @@ void MD5::update (uint8_t* input, uint32_t input_length) {
 }
 
 void MD5::update(FILE *file) {
-  uint8_t buffer[1024];
+  uint8_t buffer_[1024];
   int len;
 
-  while ((len=fread(buffer, 1, 1024, file))) update(buffer, len);
+  while ((len=fread(buffer_, 1, 1024, file))) update(buffer_, len);
 
   fclose (file);
 }
 
 void MD5::update(std::istream& stream) {
-  uint8_t buffer[1024];
+  uint8_t buffer_[1024];
   int len;
 
   while (stream.good()) {
-    stream.read((char*)buffer, 1024); // note that return value of read is unusable.
+    stream.read((char*)buffer_, 1024); // note that return value of read is unusable.
     len=stream.gcount();
-    update(buffer, len);
+    update(buffer_, len);
   }
 }
 
 void MD5::update(std::ifstream& stream) {
-  uint8_t buffer[1024];
+  uint8_t buffer_[1024];
   int len;
 
   while (stream.good()) {
-    stream.read((char*)buffer, 1024); // note that return value of read is unusable.
+    stream.read((char*)buffer_, 1024); // note that return value of read is unusable.
     len=stream.gcount();
-    update(buffer, len);
+    update(buffer_, len);
   }
 }
 
index 5429b5a..ae5f06e 100644 (file)
 
 #include <assert.h>
 
-OggSoundFile::OggSoundFile(PHYSFS_file* file, double loop_begin, double loop_at) :
+OggSoundFile::OggSoundFile(PHYSFS_file* file_, double loop_begin_, double loop_at_) :
   file(),
   vorbis_file(),
   loop_begin(),
   loop_at(),
   normal_buffer_loop()
 {
-  this->file = file;
+  this->file = file_;
 
   ov_callbacks callbacks = { cb_read, cb_seek, cb_close, cb_tell };
   ov_open_callbacks(file, &vorbis_file, 0, 0, callbacks);
@@ -37,11 +37,11 @@ OggSoundFile::OggSoundFile(PHYSFS_file* file, double loop_begin, double loop_at)
   bits_per_sample = 16;
   size            = static_cast<size_t> (ov_pcm_total(&vorbis_file, -1) * 2);
 
-  double samples_begin = loop_begin * rate;
-  double sample_loop   = loop_at * rate;
+  double samples_begin = loop_begin_ * rate;
+  double sample_loop   = loop_at_ * rate;
 
   this->loop_begin     = (ogg_int64_t) samples_begin;
-  if(loop_begin < 0) {
+  if(loop_begin_ < 0) {
     this->loop_at = (ogg_int64_t) -1;
   } else {
     this->loop_at = (ogg_int64_t) sample_loop;
index dd8fdce..e9ef764 100644 (file)
@@ -125,9 +125,9 @@ SoundManager::intern_create_sound_source(const std::string& filename)
       buffer = load_file_into_buffer(*file);
       buffers.insert(std::make_pair(filename, buffer));
     } else {
-      std::unique_ptr<StreamSoundSource> source(new StreamSoundSource);
-      source->set_sound_file(std::move(file));
-      return std::move(source);
+      std::unique_ptr<StreamSoundSource> source_(new StreamSoundSource);
+      source_->set_sound_file(std::move(file));
+      return std::move(source_);
     }
 
     log_debug << "Uncached sound \"" << filename << "\" requested to be played" << std::endl;
index 2645e0d..2c06059 100644 (file)
@@ -99,10 +99,10 @@ StreamSoundSource::update()
 }
 
 void
-StreamSoundSource::set_fading(FadeState state, float fade_time)
+StreamSoundSource::set_fading(FadeState state, float fade_time_)
 {
   this->fade_state = state;
-  this->fade_time = fade_time;
+  this->fade_time = fade_time_;
   this->fade_start_time = real_time;
 }
 
index 1dbc63b..d840066 100644 (file)
@@ -38,9 +38,9 @@ public:
   }
   void update();
 
-  void set_looping(bool looping)
+  void set_looping(bool looping_)
   {
-    this->looping = looping;
+    this->looping = looping_;
   }
   bool get_looping() const
   {
index 5aefab4..b0ffd20 100644 (file)
@@ -433,14 +433,14 @@ BadGuy::run_dead_script()
 }
 
 void
-BadGuy::set_state(State state)
+BadGuy::set_state(State state_)
 {
-  if(this->state == state)
+  if(this->state == state_)
     return;
 
   State laststate = this->state;
-  this->state = state;
-  switch(state) {
+  this->state = state_;
+  switch(state_) {
     case STATE_SQUISHED:
       state_timer.start(SQUISH_TIME);
       break;
index efd0433..a16a9f0 100644 (file)
 #include "sprite/sprite.hpp"
 #include "supertux/sector.hpp"
 
-Bomb::Bomb(const Vector& pos, Direction dir, std::string custom_sprite /*= "images/creatures/mr_bomb/mr_bomb.sprite"*/ ) :
-  BadGuy( pos, dir, custom_sprite ),
+Bomb::Bomb(const Vector& pos, Direction dir_, std::string custom_sprite /*= "images/creatures/mr_bomb/mr_bomb.sprite"*/ ) :
+  BadGuy( pos, dir_, custom_sprite ),
   state(),
   grabbed(false),
   grabber(NULL),
   ticking()
 {
   state = STATE_TICKING;
-  set_action(dir == LEFT ? "ticking-left" : "ticking-right", 1);
+  set_action(dir_ == LEFT ? "ticking-left" : "ticking-right", 1);
   countMe = false;
 
   ticking = sound_manager->create_sound_source("sounds/fizz.wav");
@@ -104,10 +104,10 @@ Bomb::kill_fall()
 }
 
 void
-Bomb::grab(MovingObject& object, const Vector& pos, Direction dir)
+Bomb::grab(MovingObject& object, const Vector& pos, Direction dir_)
 {
   movement = pos - get_pos();
-  this->dir = dir;
+  this->dir = dir_;
 
   // We actually face the opposite direction of Tux here to make the fuse more
   // visible instead of hiding it behind Tux
@@ -118,13 +118,13 @@ Bomb::grab(MovingObject& object, const Vector& pos, Direction dir)
 }
 
 void
-Bomb::ungrab(MovingObject& object, Direction dir)
+Bomb::ungrab(MovingObject& object, Direction dir_)
 {
-  this->dir = dir;
+  this->dir = dir_;
   // portable objects are usually pushed away from Tux when dropped, but we
   // don't want that, so we set the position
   //FIXME: why don't we want that? shouldn't behavior be consistent?
-  set_pos(object.get_pos() + Vector(dir == LEFT ? -16 : 16, get_bbox().get_height()*0.66666 - 32));
+  set_pos(object.get_pos() + Vector(dir_ == LEFT ? -16 : 16, get_bbox().get_height()*0.66666 - 32));
   set_colgroup_active(COLGROUP_MOVING);
   grabbed = false;
 }
index 67743d3..e00c5cd 100644 (file)
@@ -67,9 +67,9 @@ Fish::draw(DrawingContext& context)
 }
 
 HitResponse
-Fish::hit(const CollisionHit& hit)
+Fish::hit(const CollisionHit& hit_)
 {
-  if(hit.top) {
+  if(hit_.top) {
     physic.set_velocity_y(0);
   }
 
index d0d2342..8ae3259 100644 (file)
@@ -176,15 +176,15 @@ GhostTree::active_update(float elapsed_time)
       assert (suck_lantern);
       Vector pos = suck_lantern->get_pos();
       Vector delta = get_bbox().get_middle() + SUCK_TARGET_OFFSET - pos;
-      Vector dir = delta.unit();
+      Vector dir_ = delta.unit();
       if (delta.norm() < 1) {
-        dir = delta;
+        dir_ = delta;
         suck_lantern->ungrab(*this, RIGHT);
         suck_lantern->remove_me();
         suck_lantern = 0;
         sprite->set_action("swallow", 1);
       } else {
-        pos += dir;
+        pos += dir_;
         suck_lantern->grab(*this, pos, RIGHT);
       }
     } else {
index fa180ea..3569fe3 100644 (file)
@@ -168,11 +168,11 @@ GoldBomb::kill_fall()
 }
 
 void
-GoldBomb::grab(MovingObject& object, const Vector& pos, Direction dir)
+GoldBomb::grab(MovingObject& object, const Vector& pos, Direction dir_)
 {
   if(tstate == STATE_TICKING){
     movement = pos - get_pos();
-    this->dir = dir;
+    this->dir = dir_;
 
     // We actually face the opposite direction of Tux here to make the fuse more
     // visible instead of hiding it behind Tux
@@ -183,8 +183,8 @@ GoldBomb::grab(MovingObject& object, const Vector& pos, Direction dir)
   }
   else if(frozen){
     movement = pos - get_pos();
-    this->dir = dir;
-    sprite->set_action(dir == LEFT ? "iced-left" : "iced-right");
+    this->dir = dir_;
+    sprite->set_action(dir_ == LEFT ? "iced-left" : "iced-right");
     set_colgroup_active(COLGROUP_DISABLED);
     grabbed = true;
   }
index ea39114..7437ca3 100644 (file)
@@ -99,10 +99,10 @@ Kugelblitz::collision_badguy(BadGuy& other , const CollisionHit& chit)
 }
 
 HitResponse
-Kugelblitz::hit(const CollisionHit& hit)
+Kugelblitz::hit(const CollisionHit& hit_)
 {
   // hit floor?
-  if(hit.bottom) {
+  if(hit_.bottom) {
     if (!groundhit_pos_set)
     {
       pos_groundhit = get_pos();
@@ -117,7 +117,7 @@ Kugelblitz::hit(const CollisionHit& hit)
     movement_timer.start(MOVETIME);
     lifetime.start(LIFETIME);
 
-  } else if(hit.top) { // bumped on roof
+  } else if(hit_.top) { // bumped on roof
     physic.set_velocity_y(0);
   }
 
@@ -194,17 +194,17 @@ Kugelblitz::try_activate()
   float X_OFFSCREEN_DISTANCE = 400;
   float Y_OFFSCREEN_DISTANCE = 600;
 
-  Player* player = get_nearest_player();
-  if (!player) return;
-  Vector dist = player->get_bbox().get_middle() - get_bbox().get_middle();
+  Player* player_ = get_nearest_player();
+  if (!player_) return;
+  Vector dist = player_->get_bbox().get_middle() - get_bbox().get_middle();
   if ((fabsf(dist.x) <= X_OFFSCREEN_DISTANCE) && (fabsf(dist.y) <= Y_OFFSCREEN_DISTANCE)) {
     set_state(STATE_ACTIVE);
     if (!is_initialized) {
 
       // if starting direction was set to AUTO, this is our chance to re-orient the badguy
       if (start_dir == AUTO) {
-        Player* player = get_nearest_player();
-        if (player && (player->get_bbox().p1.x > get_bbox().p2.x)) {
+        Player* player__ = get_nearest_player();
+        if (player__ && (player__->get_bbox().p1.x > get_bbox().p2.x)) {
           dir = RIGHT;
         } else {
           dir = LEFT;
index a0cf0c0..6b25970 100644 (file)
@@ -31,9 +31,9 @@ MoleRock::MoleRock(const Reader& reader) :
   sound_manager->preload("sounds/stomp.wav");
 }
 
-MoleRock::MoleRock(const Vector& pos, const Vector& velocity, const BadGuy* parent = 0) :
+MoleRock::MoleRock(const Vector& pos, const Vector& velocity, const BadGuy* parent_ = 0) :
   BadGuy(pos, LEFT, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2),
-  parent(parent),
+  parent(parent_),
   initial_velocity(velocity)
 {
   physic.enable_gravity(true);
index 438d328..4acf898 100644 (file)
@@ -113,20 +113,20 @@ MrBomb::kill_fall()
 }
 
 void
-MrBomb::grab(MovingObject&, const Vector& pos, Direction dir)
+MrBomb::grab(MovingObject&, const Vector& pos, Direction dir_)
 {
   assert(frozen);
   movement = pos - get_pos();
-  this->dir = dir;
-  sprite->set_action(dir == LEFT ? "iced-left" : "iced-right");
+  this->dir = dir_;
+  sprite->set_action(dir_ == LEFT ? "iced-left" : "iced-right");
   set_colgroup_active(COLGROUP_DISABLED);
   grabbed = true;
 }
 
 void
-MrBomb::ungrab(MovingObject& , Direction dir)
+MrBomb::ungrab(MovingObject& , Direction dir_)
 {
-  this->dir = dir;
+  this->dir = dir_;
   set_colgroup_active(COLGROUP_MOVING);
   grabbed = false;
 }
index 244686e..e130557 100644 (file)
@@ -58,10 +58,10 @@ SkyDive::collision_badguy(BadGuy&, const CollisionHit& hit)
 } /* HitResponse collision_badguy */
 
 void
-SkyDive::grab (MovingObject&, const Vector& pos, Direction dir)
+SkyDive::grab (MovingObject&, const Vector& pos, Direction dir_)
 {
   movement = pos - get_pos();
-  this->dir = dir;
+  this->dir = dir_;
 
   is_grabbed = true;
 
index a4d3d8d..5ca187e 100644 (file)
@@ -28,9 +28,9 @@
 static const std::string TREEWILLOSOUND = "sounds/willowisp.wav";
 static const float       SUCKSPEED = 25;
 
-TreeWillOWisp::TreeWillOWisp(GhostTree* tree, const Vector& pos,
-                             float radius, float speed) :
-  BadGuy(tree->get_pos() + pos, "images/creatures/willowisp/willowisp.sprite",
+TreeWillOWisp::TreeWillOWisp(GhostTree* tree_, const Vector& pos,
+                             float radius_, float speed_) :
+  BadGuy(tree_->get_pos() + pos, "images/creatures/willowisp/willowisp.sprite",
          LAYER_OBJECTS - 20),
   was_sucked(false),
   mystate(STATE_DEFAULT),
@@ -39,14 +39,14 @@ TreeWillOWisp::TreeWillOWisp(GhostTree* tree, const Vector& pos,
   radius(),
   speed(),
   sound_source(),
-  tree(tree),
+  tree(tree_),
   suck_target()
 {
   sound_manager->preload(TREEWILLOSOUND);
 
-  this->radius = radius;
+  this->radius = radius_;
   this->angle  = 0;
-  this->speed  = speed;
+  this->speed  = speed_;
 
   set_colgroup_active(COLGROUP_MOVING);
 }
@@ -75,10 +75,10 @@ TreeWillOWisp::vanish()
 }
 
 void
-TreeWillOWisp::start_sucking(Vector suck_target)
+TreeWillOWisp::start_sucking(Vector suck_target_)
 {
   mystate = STATE_SUCKED;
-  this->suck_target = suck_target;
+  this->suck_target = suck_target_;
   was_sucked = true;
 }
 
@@ -126,12 +126,12 @@ TreeWillOWisp::active_update(float elapsed_time)
   }
 
   if (mystate == STATE_SUCKED) {
-    Vector dir = suck_target - get_pos();
-    if(dir.norm() < 5) {
+    Vector dir_ = suck_target - get_pos();
+    if(dir_.norm() < 5) {
       vanish();
       return;
     }
-    Vector newpos = get_pos() + dir * elapsed_time;
+    Vector newpos = get_pos() + dir_ * elapsed_time;
     movement = newpos - get_pos();
     return;
   }
@@ -152,10 +152,10 @@ TreeWillOWisp::active_update(float elapsed_time)
 }
 
 void
-TreeWillOWisp::set_color(const Color& color)
+TreeWillOWisp::set_color(const Color& color_)
 {
-  this->color = color;
-  sprite->set_color(color);
+  this->color = color_;
+  sprite->set_color(color_);
 }
 
 Color
index ad74358..5e26d49 100644 (file)
 #include "sprite/sprite.hpp"
 
 WalkingBadguy::WalkingBadguy(const Vector& pos,
-                             const std::string& sprite_name,
-                             const std::string& walk_left_action,
-                             const std::string& walk_right_action,
-                             int layer) :
-  BadGuy(pos, sprite_name, layer),
-  walk_left_action(walk_left_action),
-  walk_right_action(walk_right_action),
+                             const std::string& sprite_name_,
+                             const std::string& walk_left_action_,
+                             const std::string& walk_right_action_,
+                             int layer_) :
+  BadGuy(pos, sprite_name_, layer_),
+  walk_left_action(walk_left_action_),
+  walk_right_action(walk_right_action_),
   walk_speed(80),
   max_drop_height(-1),
   turn_around_timer(),
@@ -37,13 +37,13 @@ WalkingBadguy::WalkingBadguy(const Vector& pos,
 
 WalkingBadguy::WalkingBadguy(const Vector& pos,
                              Direction direction,
-                             const std::string& sprite_name,
-                             const std::string& walk_left_action,
-                             const std::string& walk_right_action,
-                             int layer) :
-  BadGuy(pos, direction, sprite_name, layer),
-  walk_left_action(walk_left_action),
-  walk_right_action(walk_right_action),
+                             const std::string& sprite_name_,
+                             const std::string& walk_left_action_,
+                             const std::string& walk_right_action_,
+                             int layer_) :
+  BadGuy(pos, direction, sprite_name_, layer_),
+  walk_left_action(walk_left_action_),
+  walk_right_action(walk_right_action_),
   walk_speed(80),
   max_drop_height(-1),
   turn_around_timer(),
@@ -52,13 +52,13 @@ WalkingBadguy::WalkingBadguy(const Vector& pos,
 }
 
 WalkingBadguy::WalkingBadguy(const Reader& reader,
-                             const std::string& sprite_name,
-                             const std::string& walk_left_action,
-                             const std::string& walk_right_action,
-                             int layer) :
-  BadGuy(reader, sprite_name, layer),
-  walk_left_action(walk_left_action),
-  walk_right_action(walk_right_action),
+                             const std::string& sprite_name_,
+                             const std::string& walk_left_action_,
+                             const std::string& walk_right_action_,
+                             int layer_) :
+  BadGuy(reader, sprite_name_, layer_),
+  walk_left_action(walk_left_action_),
+  walk_right_action(walk_right_action_),
   walk_speed(80),
   max_drop_height(-1),
   turn_around_timer(),
index 76298b3..7cc348a 100644 (file)
@@ -118,8 +118,8 @@ WillOWisp::active_update(float elapsed_time)
       if (dist.norm() > vanish_range) {
         vanish();
       } else if (dist.norm() >= 1) {
-        Vector dir = dist.unit();
-        movement = dir * elapsed_time * flyspeed;
+        Vector dir_ = dist.unit();
+        movement = dir_ * elapsed_time * flyspeed;
       } else {
         /* We somehow landed right on top of the player without colliding.
          * Sit tight and avoid a division by zero. */
@@ -133,8 +133,8 @@ WillOWisp::active_update(float elapsed_time)
       }
 
     case STATE_VANISHING: {
-      Vector dir = dist.unit();
-      movement = dir * elapsed_time * flyspeed;
+      Vector dir_ = dist.unit();
+      movement = dir_ * elapsed_time * flyspeed;
       if(sprite->animation_done()) {
         remove_me();
       }
index 52b07a7..88116a3 100644 (file)
@@ -23,9 +23,9 @@ CodeController::~CodeController()
 {}
 
 void
-CodeController::press(Control c, bool pressed)
+CodeController::press(Control c, bool pressed_)
 {
-  controls[c] = pressed;
+  controls[c] = pressed_;
 }
 
 void
index f6fbbe4..5043b60 100644 (file)
@@ -27,8 +27,8 @@
 #include "util/log.hpp"
 #include "util/writer.hpp"
 
-JoystickManager::JoystickManager(InputManager* parent) :
-  parent(parent),
+JoystickManager::JoystickManager(InputManager* parent_) :
+  parent(parent_),
   joy_button_map(),
   joy_axis_map(),
   joy_hat_map(),
index f49e05c..7b0d75f 100644 (file)
@@ -135,34 +135,34 @@ Background::update(float delta)
 }
 
 void
-Background::set_image(const std::string& name, float speed)
+Background::set_image(const std::string& name_, float speed_)
 {
-  this->imagefile = name;
-  this->speed = speed;
+  this->imagefile = name_;
+  this->speed = speed_;
 
-  image = Surface::create(name);
+  image = Surface::create(name_);
 }
 
 void
-Background::draw_image(DrawingContext& context, const Vector& pos)
+Background::draw_image(DrawingContext& context, const Vector& pos_)
 {
   Sizef level(Sector::current()->get_width(), Sector::current()->get_height());
   Sizef screen(SCREEN_WIDTH, SCREEN_HEIGHT);
   Sizef parallax_image_size = (1.0f - speed) * screen + level * speed;
   Rectf cliprect = context.get_cliprect();
 
-  int start_x = static_cast<int>(floorf((cliprect.get_left()  - (pos.x - image->get_width() /2.0f)) / image->get_width()));
-  int end_x   = static_cast<int>(ceilf((cliprect.get_right()  - (pos.x + image->get_width() /2.0f)) / image->get_width()))+1;
-  int start_y = static_cast<int>(floorf((cliprect.get_top()   - (pos.y - image->get_height()/2.0f)) / image->get_height()));
-  int end_y   = static_cast<int>(ceilf((cliprect.get_bottom() - (pos.y + image->get_height()/2.0f)) / image->get_height()))+1;
+  int start_x = static_cast<int>(floorf((cliprect.get_left()  - (pos_.x - image->get_width() /2.0f)) / image->get_width()));
+  int end_x   = static_cast<int>(ceilf((cliprect.get_right()  - (pos_.x + image->get_width() /2.0f)) / image->get_width()))+1;
+  int start_y = static_cast<int>(floorf((cliprect.get_top()   - (pos_.y - image->get_height()/2.0f)) / image->get_height()));
+  int end_y   = static_cast<int>(ceilf((cliprect.get_bottom() - (pos_.y + image->get_height()/2.0f)) / image->get_height()))+1;
 
   switch(alignment)
   {
     case LEFT_ALIGNMENT:
       for(int y = start_y; y < end_y; ++y)
       {
-        Vector p(pos.x - parallax_image_size.width / 2.0f,
-                 pos.y + y * image->get_height()  - image->get_height() / 2.0f);
+        Vector p(pos_.x - parallax_image_size.width / 2.0f,
+                 pos_.y + y * image->get_height()  - image->get_height() / 2.0f);
         context.draw_surface(image, p, layer);
       }
       break;
@@ -170,8 +170,8 @@ Background::draw_image(DrawingContext& context, const Vector& pos)
     case RIGHT_ALIGNMENT:
       for(int y = start_y; y < end_y; ++y)
       {
-        Vector p(pos.x + parallax_image_size.width / 2.0f - image->get_width(),
-                 pos.y + y * image->get_height() - image->get_height() / 2.0f);
+        Vector p(pos_.x + parallax_image_size.width / 2.0f - image->get_width(),
+                 pos_.y + y * image->get_height() - image->get_height() / 2.0f);
         context.draw_surface(image, p, layer);
       }
       break;
@@ -179,8 +179,8 @@ Background::draw_image(DrawingContext& context, const Vector& pos)
     case TOP_ALIGNMENT:
       for(int x = start_x; x < end_x; ++x)
       {
-        Vector p(pos.x + x * image->get_width() - image->get_width() / 2.0f,
-                 pos.y - parallax_image_size.height / 2.0f);
+        Vector p(pos_.x + x * image->get_width() - image->get_width() / 2.0f,
+                 pos_.y - parallax_image_size.height / 2.0f);
         context.draw_surface(image, p, layer);
       }
       break;
@@ -188,8 +188,8 @@ Background::draw_image(DrawingContext& context, const Vector& pos)
     case BOTTOM_ALIGNMENT:
       for(int x = start_x; x < end_x; ++x)
       {
-        Vector p(pos.x + x * image->get_width()  - image->get_width() / 2.0f,
-                 pos.y - image->get_height() + parallax_image_size.height / 2.0f);
+        Vector p(pos_.x + x * image->get_width()  - image->get_width() / 2.0f,
+                 pos_.y - image->get_height() + parallax_image_size.height / 2.0f);
         context.draw_surface(image, p, layer);
       }
       break;
@@ -198,8 +198,8 @@ Background::draw_image(DrawingContext& context, const Vector& pos)
       for(int y = start_y; y < end_y; ++y)
         for(int x = start_x; x < end_x; ++x)
         {
-          Vector p(pos.x + x * image->get_width()  - image->get_width()/2,
-                   pos.y + y * image->get_height() - image->get_height()/2);
+          Vector p(pos_.x + x * image->get_width()  - image->get_width()/2,
+                   pos_.y + y * image->get_height() - image->get_height()/2);
 
           if (image_top.get() != NULL && (y < 0))
           {
index 5c0927b..7387f72 100644 (file)
@@ -37,9 +37,9 @@ BicyclePlatform::BicyclePlatform(const Reader& reader) :
   center = get_pos();
 }
 
-BicyclePlatform::BicyclePlatform(BicyclePlatform* master) :
+BicyclePlatform::BicyclePlatform(BicyclePlatform* master_) :
   MovingSprite(*master),
-  master(master),
+  master(master_),
   slave(this),
   center(master->center),
   radius(master->radius),
@@ -102,8 +102,8 @@ BicyclePlatform::update(float elapsed_time)
     angle = master->angle + M_PI;
     while (angle < 0) { angle += 2*M_PI; }
     while (angle > 2*M_PI) { angle -= 2*M_PI; }
-    Vector dest = center + Vector(cosf(angle), sinf(angle)) * radius - (bbox.get_size().as_vector() * 0.5);
-    movement = dest - get_pos();
+    Vector dest_ = center + Vector(cosf(angle), sinf(angle)) * radius - (bbox.get_size().as_vector() * 0.5);
+    movement = dest_ - get_pos();
   }
   if (this == master) {
     float momentum_diff = momentum - slave->momentum;
@@ -118,8 +118,8 @@ BicyclePlatform::update(float elapsed_time)
     while (angle < 0) { angle += 2*M_PI; }
     while (angle > 2*M_PI) { angle -= 2*M_PI; }
     angular_speed = std::min(std::max(angular_speed, static_cast<float>(-128*M_PI*elapsed_time)), static_cast<float>(128*M_PI*elapsed_time));
-    Vector dest = center + Vector(cosf(angle), sinf(angle)) * radius - (bbox.get_size().as_vector() * 0.5);
-    movement = dest - get_pos();
+    Vector dest_ = center + Vector(cosf(angle), sinf(angle)) * radius - (bbox.get_size().as_vector() * 0.5);
+    movement = dest_ - get_pos();
 
     center += Vector(angular_speed, 0) * elapsed_time * 32;
     slave->center += Vector(angular_speed, 0) * elapsed_time * 32;
index 044f470..b3f80ba 100644 (file)
@@ -169,7 +169,7 @@ BonusBlock::hit(Player & player)
 }
 
 HitResponse
-BonusBlock::collision(GameObject& other, const CollisionHit& hit){
+BonusBlock::collision(GameObject& other, const CollisionHit& hit_){
 
   Player* player = dynamic_cast<Player*> (&other);
   if (player) {
@@ -193,7 +193,7 @@ BonusBlock::collision(GameObject& other, const CollisionHit& hit){
       try_open(player);
     }
   }
-  return Block::collision(other, hit);
+  return Block::collision(other, hit_);
 }
 
 void
@@ -337,12 +337,12 @@ BonusBlock::try_drop(Player *player)
   assert(sector);
 
   // First what's below the bonus block, if solid send it up anyway (excepting doll)
-  Rectf dest;
-  dest.p1.x = bbox.get_left() + 1;
-  dest.p1.y = bbox.get_bottom() + 1;
-  dest.p2.x = bbox.get_right() - 1;
-  dest.p2.y = dest.p1.y + 30;
-  if (!Sector::current()->is_free_of_statics(dest, this, true) && !(contents == CONTENT_1UP)) {
+  Rectf dest_;
+  dest_.p1.x = bbox.get_left() + 1;
+  dest_.p1.y = bbox.get_bottom() + 1;
+  dest_.p2.x = bbox.get_right() - 1;
+  dest_.p2.y = dest_.p1.y + 30;
+  if (!Sector::current()->is_free_of_statics(dest_, this, true) && !(contents == CONTENT_1UP)) {
     try_open(player);
     return;
   }
index 3de3031..5340eda 100644 (file)
 #include "math/random_generator.hpp"
 #include "sprite/sprite.hpp"
 
-BrokenBrick::BrokenBrick(SpritePtr sprite,
+BrokenBrick::BrokenBrick(SpritePtr sprite_,
                          const Vector& pos, const Vector& nmovement) :
   timer(),
-  sprite(sprite),
+  sprite(sprite_),
   position(pos),
   movement(nmovement)
 {
index f1a3d8a..c6a4867 100644 (file)
@@ -27,13 +27,13 @@ const float BULLET_XM = 600;
 const float BULLET_STARTING_YM = 0;
 }
 
-Bullet::Bullet(const Vector& pos, float xm, int dir, BonusType type) :
+Bullet::Bullet(const Vector& pos, float xm, int dir, BonusType type_) :
   physic(),
   life_count(3),
   sprite(),
   light(0.0f,0.0f,0.0f),
   lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-small.sprite")),
-  type(type)
+  type(type_)
 {
   float speed = dir == RIGHT ? BULLET_XM : -BULLET_XM;
   physic.set_velocity_x(speed + xm);
index 0f75396..abca4a7 100644 (file)
@@ -111,7 +111,7 @@ public:
   }
 };
 
-Camera::Camera(Sector* newsector, std::string name) :
+Camera::Camera(Sector* newsector, std::string name_) :
   mode(NORMAL),
   translation(),
   sector(newsector),
@@ -132,7 +132,7 @@ Camera::Camera(Sector* newsector, std::string name) :
   scrollspeed(),
   config()
 {
-  this->name = name;
+  this->name = name_;
   config = new CameraConfig();
   reload_config();
 }
@@ -276,19 +276,19 @@ float clamp(float val, float min, float max)
 }
 
 void
-Camera::keep_in_bounds(Vector& translation)
+Camera::keep_in_bounds(Vector& translation_)
 {
   float width = sector->get_width();
   float height = sector->get_height();
 
   // don't scroll before the start or after the level's end
-  translation.x = clamp(translation.x, 0, width - SCREEN_WIDTH);
-  translation.y = clamp(translation.y, 0, height - SCREEN_HEIGHT);
+  translation_.x = clamp(translation_.x, 0, width - SCREEN_WIDTH);
+  translation_.y = clamp(translation_.y, 0, height - SCREEN_HEIGHT);
 
   if (height < SCREEN_HEIGHT)
-    translation.y = height/2.0 - SCREEN_HEIGHT/2.0;
+    translation_.y = height/2.0 - SCREEN_HEIGHT/2.0;
   if (width < SCREEN_WIDTH)
-    translation.x = width/2.0 - SCREEN_WIDTH/2.0;
+    translation_.x = width/2.0 - SCREEN_WIDTH/2.0;
 }
 
 void
@@ -303,7 +303,7 @@ Camera::shake()
 void
 Camera::update_scroll_normal(float elapsed_time)
 {
-  const CameraConfig& config = *(this->config);
+  const CameraConfig& config_ = *(this->config);
   Player* player = sector->player;
   // TODO: co-op mode needs a good camera
   Vector player_pos(player->get_bbox().get_middle().x,
@@ -317,13 +317,13 @@ Camera::update_scroll_normal(float elapsed_time)
     return;
 
   /****** Vertical Scrolling part ******/
-  int ymode = config.ymode;
+  int ymode = config_.ymode;
 
   if(player->is_dying() || sector->get_height() == 19*32) {
     ymode = 0;
   }
   if(ymode == 1) {
-    cached_translation.y = player_pos.y - SCREEN_HEIGHT * config.target_y;
+    cached_translation.y = player_pos.y - SCREEN_HEIGHT * config_.target_y;
   }
   if(ymode == 2) {
     // target_y is the high we target our scrolling at. This is not always the
@@ -335,7 +335,7 @@ Camera::update_scroll_normal(float elapsed_time)
       target_y = player->last_ground_y + player->get_bbox().get_height();
     else
       target_y = player->get_bbox().p2.y;
-    target_y -= SCREEN_HEIGHT * config.target_y;
+    target_y -= SCREEN_HEIGHT * config_.target_y;
 
     // delta_y is the distance we'd have to travel to directly reach target_y
     float delta_y = cached_translation.y - target_y;
@@ -345,32 +345,32 @@ Camera::update_scroll_normal(float elapsed_time)
     // limit the camera speed when jumping upwards
     if(player->fall_mode != Player::FALLING
        && player->fall_mode != Player::TRAMPOLINE_JUMP) {
-      speed_y = clamp(speed_y, -config.max_speed_y, config.max_speed_y);
+      speed_y = clamp(speed_y, -config_.max_speed_y, config_.max_speed_y);
     }
 
     // scroll with calculated speed
     cached_translation.y -= speed_y * elapsed_time;
   }
   if(ymode == 3) {
-    float halfsize = config.kirby_rectsize_y * 0.5f;
+    float halfsize = config_.kirby_rectsize_y * 0.5f;
     cached_translation.y = clamp(cached_translation.y,
                                  player_pos.y - SCREEN_HEIGHT * (0.5f + halfsize),
                                  player_pos.y - SCREEN_HEIGHT * (0.5f - halfsize));
   }
   if(ymode == 4) {
-    float upperend = SCREEN_HEIGHT * config.edge_x;
-    float lowerend = SCREEN_HEIGHT * (1 - config.edge_x);
+    float upperend = SCREEN_HEIGHT * config_.edge_x;
+    float lowerend = SCREEN_HEIGHT * (1 - config_.edge_x);
 
     if (player_delta.y < -CAMERA_EPSILON) {
       // walking left
-      lookahead_pos.y -= player_delta.y * config.dynamic_speed_sm;
+      lookahead_pos.y -= player_delta.y * config_.dynamic_speed_sm;
 
       if(lookahead_pos.y > lowerend) {
         lookahead_pos.y = lowerend;
       }
     } else if (player_delta.y > CAMERA_EPSILON) {
       // walking right
-      lookahead_pos.y -= player_delta.y * config.dynamic_speed_sm;
+      lookahead_pos.y -= player_delta.y * config_.dynamic_speed_sm;
       if(lookahead_pos.y < upperend) {
         lookahead_pos.y = upperend;
       }
@@ -391,12 +391,12 @@ Camera::update_scroll_normal(float elapsed_time)
 
   if(ymode != 0) {
     float top_edge, bottom_edge;
-    if(config.clamp_y <= 0) {
+    if(config_.clamp_y <= 0) {
       top_edge = 0;
       bottom_edge = SCREEN_HEIGHT;
     } else {
-      top_edge = SCREEN_HEIGHT*config.clamp_y;
-      bottom_edge = SCREEN_HEIGHT*(1-config.clamp_y);
+      top_edge = SCREEN_HEIGHT*config_.clamp_y;
+      bottom_edge = SCREEN_HEIGHT*(1-config_.clamp_y);
     }
 
     float peek_to = 0;
@@ -417,24 +417,24 @@ Camera::update_scroll_normal(float elapsed_time)
 
     translation.y -= peek_pos.y;
 
-    if(config.clamp_y > 0) {
+    if(config_.clamp_y > 0) {
       translation.y = clamp(translation.y,
-                            player_pos.y - SCREEN_HEIGHT * (1-config.clamp_y),
-                            player_pos.y - SCREEN_HEIGHT * config.clamp_y);
+                            player_pos.y - SCREEN_HEIGHT * (1-config_.clamp_y),
+                            player_pos.y - SCREEN_HEIGHT * config_.clamp_y);
       cached_translation.y = clamp(cached_translation.y,
-                                   player_pos.y - SCREEN_HEIGHT * (1-config.clamp_y),
-                                   player_pos.y - SCREEN_HEIGHT * config.clamp_y);
+                                   player_pos.y - SCREEN_HEIGHT * (1-config_.clamp_y),
+                                   player_pos.y - SCREEN_HEIGHT * config_.clamp_y);
     }
   }
 
   /****** Horizontal scrolling part *******/
-  int xmode = config.xmode;
+  int xmode = config_.xmode;
 
   if(player->is_dying())
     xmode = 0;
 
   if(xmode == 1) {
-    cached_translation.x = player_pos.x - SCREEN_WIDTH * config.target_x;
+    cached_translation.x = player_pos.x - SCREEN_WIDTH * config_.target_x;
   }
   if(xmode == 2) {
     // our camera is either in leftscrolling, rightscrolling or
@@ -452,9 +452,9 @@ Camera::update_scroll_normal(float elapsed_time)
     else walkDirection = LOOKAHEAD_RIGHT;
 
     float LEFTEND, RIGHTEND;
-    if(config.sensitive_x > 0) {
-      LEFTEND = SCREEN_WIDTH * config.sensitive_x;
-      RIGHTEND = SCREEN_WIDTH * (1-config.sensitive_x);
+    if(config_.sensitive_x > 0) {
+      LEFTEND = SCREEN_WIDTH * config_.sensitive_x;
+      RIGHTEND = SCREEN_WIDTH * (1-config_.sensitive_x);
     } else {
       LEFTEND = SCREEN_WIDTH;
       RIGHTEND = 0;
@@ -482,7 +482,7 @@ Camera::update_scroll_normal(float elapsed_time)
        * sudden changes */
       if(changetime < 0) {
         changetime = game_time;
-      } else if(game_time - changetime > config.dirchange_time) {
+      } else if(game_time - changetime > config_.dirchange_time) {
         if(lookahead_mode == LOOKAHEAD_LEFT &&
            player_pos.x > cached_translation.x + RIGHTEND) {
           lookahead_mode = LOOKAHEAD_RIGHT;
@@ -497,8 +497,8 @@ Camera::update_scroll_normal(float elapsed_time)
       changetime = -1;
     }
 
-    LEFTEND = SCREEN_WIDTH * config.edge_x;
-    RIGHTEND = SCREEN_WIDTH * (1-config.edge_x);
+    LEFTEND = SCREEN_WIDTH * config_.edge_x;
+    RIGHTEND = SCREEN_WIDTH * (1-config_.edge_x);
 
     // calculate our scroll target depending on scroll mode
     float target_x;
@@ -516,32 +516,32 @@ Camera::update_scroll_normal(float elapsed_time)
 
     // limit our speed
     float player_speed_x = player_delta.x / elapsed_time;
-    float maxv = config.max_speed_x + (fabsf(player_speed_x * config.dynamic_max_speed_x));
+    float maxv = config_.max_speed_x + (fabsf(player_speed_x * config_.dynamic_max_speed_x));
     speed_x = clamp(speed_x, -maxv, maxv);
 
     // apply scrolling
     cached_translation.x -= speed_x * elapsed_time;
   }
   if(xmode == 3) {
-    float halfsize = config.kirby_rectsize_x * 0.5f;
+    float halfsize = config_.kirby_rectsize_x * 0.5f;
     cached_translation.x = clamp(cached_translation.x,
                                  player_pos.x - SCREEN_WIDTH * (0.5f + halfsize),
                                  player_pos.x - SCREEN_WIDTH * (0.5f - halfsize));
   }
   if(xmode == 4) {
-    float LEFTEND = SCREEN_WIDTH * config.edge_x;
-    float RIGHTEND = SCREEN_WIDTH * (1 - config.edge_x);
+    float LEFTEND = SCREEN_WIDTH * config_.edge_x;
+    float RIGHTEND = SCREEN_WIDTH * (1 - config_.edge_x);
 
     if (player_delta.x < -CAMERA_EPSILON) {
       // walking left
-      lookahead_pos.x -= player_delta.x * config.dynamic_speed_sm;
+      lookahead_pos.x -= player_delta.x * config_.dynamic_speed_sm;
       if(lookahead_pos.x > RIGHTEND) {
         lookahead_pos.x = RIGHTEND;
       }
 
     } else if (player_delta.x > CAMERA_EPSILON) {
       // walking right
-      lookahead_pos.x -= player_delta.x * config.dynamic_speed_sm;
+      lookahead_pos.x -= player_delta.x * config_.dynamic_speed_sm;
       if(lookahead_pos.x < LEFTEND) {
         lookahead_pos.x = LEFTEND;
       }
@@ -562,12 +562,12 @@ Camera::update_scroll_normal(float elapsed_time)
 
   if(xmode != 0) {
     float left_edge, right_edge;
-    if(config.clamp_x <= 0) {
+    if(config_.clamp_x <= 0) {
       left_edge = 0;
       right_edge = SCREEN_WIDTH;
     } else {
-      left_edge = SCREEN_WIDTH*config.clamp_x;
-      right_edge = SCREEN_WIDTH*(1-config.clamp_x);
+      left_edge = SCREEN_WIDTH*config_.clamp_x;
+      right_edge = SCREEN_WIDTH*(1-config_.clamp_x);
     }
 
     float peek_to = 0;
@@ -588,14 +588,14 @@ Camera::update_scroll_normal(float elapsed_time)
 
     translation.x -= peek_pos.x;
 
-    if(config.clamp_x > 0) {
+    if(config_.clamp_x > 0) {
       translation.x = clamp(translation.x,
-                            player_pos.x - SCREEN_WIDTH * (1-config.clamp_x),
-                            player_pos.x - SCREEN_WIDTH * config.clamp_x);
+                            player_pos.x - SCREEN_WIDTH * (1-config_.clamp_x),
+                            player_pos.x - SCREEN_WIDTH * config_.clamp_x);
 
       cached_translation.x = clamp(cached_translation.x,
-                                   player_pos.x - SCREEN_WIDTH * (1-config.clamp_x),
-                                   player_pos.x - SCREEN_WIDTH * config.clamp_x);
+                                   player_pos.x - SCREEN_WIDTH * (1-config_.clamp_x),
+                                   player_pos.x - SCREEN_WIDTH * config_.clamp_x);
     }
   }
 
index a9abc9d..a3b8f15 100644 (file)
@@ -117,11 +117,11 @@ Candle::get_burning()
 }
 
 void
-Candle::set_burning(bool burning)
+Candle::set_burning(bool burning_)
 {
-  if (this->burning == burning) return;
-  this->burning = burning;
-  if (burning) {
+  if (this->burning == burning_) return;
+  this->burning = burning_;
+  if (burning_) {
     sprite->set_action("on");
   } else {
     sprite->set_action("off");
index 89ac199..e884a2b 100644 (file)
@@ -22,7 +22,7 @@
 
 static const float BORDER_SIZE = 75;
 
-DisplayEffect::DisplayEffect(std::string name) :
+DisplayEffect::DisplayEffect(const std::string& name_) :
   screen_fade(NO_FADE),
   screen_fadetime(0),
   screen_fading(0),
@@ -33,7 +33,7 @@ DisplayEffect::DisplayEffect(std::string name) :
   black(false),
   borders(false)
 {
-  this->name = name;
+  this->name = name_;
 }
 
 DisplayEffect::~DisplayEffect()
index f2f8774..6ea34c7 100644 (file)
@@ -26,7 +26,7 @@ class DisplayEffect : public GameObject,
                       public ScriptInterface
 {
 public:
-  DisplayEffect(std::string name = "");
+  DisplayEffect(const std::string& name = std::string());
   virtual ~DisplayEffect();
 
   void expose(HSQUIRRELVM vm, SQInteger table_idx);
index 0c19566..40d3740 100644 (file)
@@ -67,17 +67,17 @@ FloatingImage::get_action()
 }
 
 void
-FloatingImage::fade_in(float fadetime)
+FloatingImage::fade_in(float fadetime_)
 {
-  this->fadetime = fadetime;
-  fading = fadetime;
+  this->fadetime = fadetime_;
+  fading = fadetime_;
 }
 
 void
-FloatingImage::fade_out(float fadetime)
+FloatingImage::fade_out(float fadetime_)
 {
-  this->fadetime = fadetime;
-  fading = -fadetime;
+  this->fadetime = fadetime_;
+  fading = -fadetime_;
 }
 
 void
index 85a7697..eb8c6e1 100644 (file)
@@ -29,30 +29,30 @@ public:
   FloatingImage(const std::string& sprite);
   virtual ~FloatingImage();
 
-  void set_layer(int layer) {
-    this->layer = layer;
+  void set_layer(int layer_) {
+    this->layer = layer_;
   }
 
   int get_layer() const {
     return layer;
   }
 
-  void set_pos(const Vector& pos) {
-    this->pos = pos;
+  void set_pos(const Vector& pos_) {
+    this->pos = pos_;
   }
   const Vector& get_pos() const {
     return pos;
   }
 
-  void set_anchor_point(AnchorPoint anchor) {
-    this->anchor = anchor;
+  void set_anchor_point(AnchorPoint anchor_) {
+    this->anchor = anchor_;
   }
   AnchorPoint get_anchor_point() const {
     return anchor;
   }
 
-  void set_visible(bool visible) {
-    this->visible = visible;
+  void set_visible(bool visible_) {
+    this->visible = visible_;
   }
   bool get_visible() const {
     return visible;
index a83efce..e8374ff 100644 (file)
@@ -79,10 +79,10 @@ IceCrusher::IceCrusher(const Reader& reader) :
   }
 */
 void
-IceCrusher::set_state(IceCrusherState state, bool force)
+IceCrusher::set_state(IceCrusherState state_, bool force)
 {
-  if ((this->state == state) && (!force)) return;
-  switch(state) {
+  if ((this->state == state_) && (!force)) return;
+  switch(state_) {
     case IDLE:
       set_group(COLGROUP_STATIC);
       physic.enable_gravity (false);
@@ -103,7 +103,7 @@ IceCrusher::set_state(IceCrusherState state, bool force)
       log_debug << "IceCrusher in invalid state" << std::endl;
       break;
   }
-  this->state = state;
+  this->state = state_;
 }
 
 HitResponse
index 4269829..3996070 100644 (file)
@@ -95,14 +95,15 @@ InfoBlock::hit(Player& player)
 }
 
 HitResponse
-InfoBlock::collision(GameObject& other, const CollisionHit& hit){
-
-       Player* player = dynamic_cast<Player*> (&other);
-       if (player) {
-               if (player->does_buttjump)
-                       InfoBlock::hit(*player);
-       }
-       return Block::collision(other, hit);
+InfoBlock::collision(GameObject& other, const CollisionHit& hit_)
+{
+  Player* player = dynamic_cast<Player*> (&other);
+  if (player) 
+  {
+    if (player->does_buttjump)
+      InfoBlock::hit(*player);
+  }
+  return Block::collision(other, hit_);
 }
 
 Player*
index 4cf041d..0ab963f 100644 (file)
@@ -120,9 +120,9 @@ LevelTime::get_time()
 }
 
 void
-LevelTime::set_time(float time_left)
+LevelTime::set_time(float time_left_)
 {
-  this->time_left = std::min(std::max(time_left, 0.0f), 999.0f);
+  this->time_left = std::min(std::max(time_left_, 0.0f), 999.0f);
 }
 
 /* EOF */
index 59a81ef..a9d877a 100644 (file)
 
 #include <stdexcept>
 
-MovingSprite::MovingSprite(const Vector& pos, const std::string& sprite_name,
-                           int layer, CollisionGroup collision_group) :
-  sprite_name(sprite_name),
+MovingSprite::MovingSprite(const Vector& pos, const std::string& sprite_name_,
+                           int layer_, CollisionGroup collision_group) :
+  sprite_name(sprite_name_),
   sprite(),
-  layer(layer)
+  layer(layer_)
 {
   bbox.set_pos(pos);
   sprite = sprite_manager->create(sprite_name);
@@ -33,10 +33,10 @@ MovingSprite::MovingSprite(const Vector& pos, const std::string& sprite_name,
   set_group(collision_group);
 }
 
-MovingSprite::MovingSprite(const Reader& reader, const Vector& pos, int layer, CollisionGroup collision_group) :
+MovingSprite::MovingSprite(const Reader& reader, const Vector& pos, int layer_, CollisionGroup collision_group) :
   sprite_name(),
   sprite(),
-  layer(layer)
+  layer(layer_)
 {
   bbox.set_pos(pos);
   if (!reader.get("sprite", sprite_name))
@@ -47,10 +47,10 @@ MovingSprite::MovingSprite(const Reader& reader, const Vector& pos, int layer, C
   set_group(collision_group);
 }
 
-MovingSprite::MovingSprite(const Reader& reader, const std::string& sprite_name, int layer, CollisionGroup collision_group) :
-  sprite_name(sprite_name),
+MovingSprite::MovingSprite(const Reader& reader, const std::string& sprite_name_, int layer_, CollisionGroup collision_group) :
+  sprite_name(sprite_name_),
   sprite(),
-  layer(layer)
+  layer(layer_)
 {
   reader.get("x", bbox.p1.x);
   reader.get("y", bbox.p1.y);
@@ -61,10 +61,10 @@ MovingSprite::MovingSprite(const Reader& reader, const std::string& sprite_name,
   set_group(collision_group);
 }
 
-MovingSprite::MovingSprite(const Reader& reader, int layer, CollisionGroup collision_group) :
+MovingSprite::MovingSprite(const Reader& reader, int layer_, CollisionGroup collision_group) :
   sprite_name(),
   sprite(),
-  layer(layer)
+  layer(layer_)
 {
   reader.get("x", bbox.p1.x);
   reader.get("y", bbox.p1.y);
index 47d18a4..a34db12 100644 (file)
@@ -19,8 +19,8 @@
 #include <math.h>
 #include <assert.h>
 
-PathWalker::PathWalker(const Path* path, bool running_) :
-  path(path),
+PathWalker::PathWalker(const Path* path_, bool running_) :
+  path(path_),
   running(running_),
   current_node_nr(0),
   next_node_nr(0),
index 5d7e640..8a09076 100644 (file)
@@ -109,7 +109,7 @@ static const float DUCKED_TUX_HEIGHT = 31.8f;
 bool no_water = true;
 }
 
-Player::Player(PlayerStatus* _player_status, const std::string& name) :
+Player::Player(PlayerStatus* _player_status, const std::string& name_) :
   deactivated(),
   controller(),
   scripting_controller(),
@@ -159,7 +159,7 @@ Player::Player(PlayerStatus* _player_status, const std::string& name) :
   idle_stage(0),
   climbing(0)
 {
-  this->name = name;
+  this->name = name_;
   controller = g_input_manager->get_controller();
   scripting_controller.reset(new CodeController());
   // if/when we have complete penny gfx, we can
@@ -260,9 +260,9 @@ Player::set_speedlimit(float newlimit)
 }
 
 void
-Player::set_controller(Controller* controller)
+Player::set_controller(Controller* controller_)
 {
-  this->controller = controller;
+  this->controller = controller_;
 }
 
 void
@@ -815,18 +815,18 @@ Player::handle_input()
     if(moving_object) {
       // move the grabbed object a bit away from tux
       Rectf grabbed_bbox = moving_object->get_bbox();
-      Rectf dest;
-      dest.p2.y = bbox.get_top() + bbox.get_height()*0.66666;
-      dest.p1.y = dest.p2.y - grabbed_bbox.get_height();
+      Rectf dest_;
+      dest_.p2.y = bbox.get_top() + bbox.get_height()*0.66666;
+      dest_.p1.y = dest_.p2.y - grabbed_bbox.get_height();
       if(dir == LEFT) {
-        dest.p2.x = bbox.get_left() - 1;
-        dest.p1.x = dest.p2.x - grabbed_bbox.get_width();
+        dest_.p2.x = bbox.get_left() - 1;
+        dest_.p1.x = dest_.p2.x - grabbed_bbox.get_width();
       } else {
-        dest.p1.x = bbox.get_right() + 1;
-        dest.p2.x = dest.p1.x + grabbed_bbox.get_width();
+        dest_.p1.x = bbox.get_right() + 1;
+        dest_.p2.x = dest_.p1.x + grabbed_bbox.get_width();
       }
-      if(Sector::current()->is_free_of_tiles(dest, true)) {
-        moving_object->set_pos(dest.p1);
+      if(Sector::current()->is_free_of_tiles(dest_, true)) {
+        moving_object->set_pos(dest_.p1);
         if(controller->hold(Controller::UP)) {
           grabbed_object->ungrab(*this, UP);
         } else {
@@ -1034,10 +1034,10 @@ Player::set_bonus(BonusType type, bool animate)
 }
 
 void
-Player::set_visible(bool visible)
+Player::set_visible(bool visible_)
 {
-  this->visible = visible;
-  if( visible )
+  this->visible = visible_;
+  if( visible_ )
     set_group(COLGROUP_MOVING);
   else
     set_group(COLGROUP_DISABLED);
index cba9038..b295de8 100644 (file)
@@ -33,12 +33,12 @@ PneumaticPlatform::PneumaticPlatform(const Reader& reader) :
   start_y = get_pos().y;
 }
 
-PneumaticPlatform::PneumaticPlatform(PneumaticPlatform* master) :
-  MovingSprite(*master),
-  master(master),
+PneumaticPlatform::PneumaticPlatform(PneumaticPlatform* master_) :
+  MovingSprite(*master_),
+  master(master_),
   slave(this),
-  start_y(master->start_y),
-  offset_y(-master->offset_y),
+  start_y(master_->start_y),
+  offset_y(-master_->offset_y),
   speed_y(0),
   contacts()
 {
index 53fa407..09feaaf 100644 (file)
@@ -57,8 +57,8 @@ PowerUp::PowerUp(const Reader& lisp) :
 
 }
 
-PowerUp::PowerUp(const Vector& pos, const std::string& sprite_name) :
-  MovingSprite(pos, sprite_name, LAYER_OBJECTS, COLGROUP_MOVING),
+PowerUp::PowerUp(const Vector& pos, const std::string& sprite_name_) :
+  MovingSprite(pos, sprite_name_, LAYER_OBJECTS, COLGROUP_MOVING),
   physic(),
   script(),
   no_physics(false),
index 1224049..82e70fa 100644 (file)
 #include <stdexcept>
 
 SpriteParticle::SpriteParticle(std::string sprite_name, std::string action,
-                               Vector position, AnchorPoint anchor, Vector velocity, Vector acceleration,
+                               Vector position_, AnchorPoint anchor, Vector velocity_, Vector acceleration_,
                                int drawing_layer_) :
   sprite(),
-  position(position),
-  velocity(velocity),
-  acceleration(acceleration),
+  position(position_),
+  velocity(velocity_),
+  acceleration(acceleration_),
   drawing_layer(drawing_layer_),
   light(0.0f,0.0f,0.0f),
   lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-tiny.sprite")),
index 7db2cac..ea1e4eb 100644 (file)
@@ -21,7 +21,7 @@
 #include "supertux/resources.hpp"
 #include "video/drawing_context.hpp"
 
-TextObject::TextObject(std::string name) :
+TextObject::TextObject(std::string name_) :
   font(),
   text(),
   fading(0),
@@ -31,7 +31,7 @@ TextObject::TextObject(std::string name) :
   anchor(ANCHOR_MIDDLE),
   pos(0, 0)
 {
-  this->name = name;
+  this->name = name_;
   font = Resources::normal_font;
   centered = false;
 }
@@ -59,51 +59,51 @@ TextObject::unexpose(HSQUIRRELVM vm, SQInteger table_idx)
 }
 
 void
-TextObject::set_font(const std::string& name)
+TextObject::set_font(const std::string& name_)
 {
-  if(name == "normal") {
+  if(name_ == "normal") {
     font = Resources::normal_font;
-  } else if(name == "big") {
+  } else if(name_ == "big") {
     font = Resources::big_font;
-  } else if(name == "small") {
+  } else if(name_ == "small") {
     font = Resources::small_font;
   } else {
-    log_warning << "Unknown font '" << name << "'." << std::endl;
+    log_warning << "Unknown font '" << name_ << "'." << std::endl;
     font = Resources::normal_font;
   }
 }
 
 void
-TextObject::set_text(const std::string& text)
+TextObject::set_text(const std::string& text_)
 {
-  this->text = text;
+  this->text = text_;
 }
 
 void
-TextObject::fade_in(float fadetime)
+TextObject::fade_in(float fadetime_)
 {
-  this->fadetime = fadetime;
-  fading = fadetime;
+  this->fadetime = fadetime_;
+  fading = fadetime_;
 }
 
 void
-TextObject::fade_out(float fadetime)
+TextObject::fade_out(float fadetime_)
 {
-  this->fadetime = fadetime;
-  fading = -fadetime;
+  this->fadetime = fadetime_;
+  fading = -fadetime_;
 }
 
 void
-TextObject::set_visible(bool visible)
+TextObject::set_visible(bool visible_)
 {
-  this->visible = visible;
+  this->visible = visible_;
   fading = 0;
 }
 
 void
-TextObject::set_centered(bool centered)
+TextObject::set_centered(bool centered_)
 {
-  this->centered = centered;
+  this->centered = centered_;
 }
 
 void
index 4605eef..4a36b71 100644 (file)
@@ -45,15 +45,15 @@ public:
   void set_centered(bool centered);
   bool is_visible();
 
-  void set_anchor_point(AnchorPoint anchor) {
-    this->anchor = anchor;
+  void set_anchor_point(AnchorPoint anchor_) {
+    this->anchor = anchor_;
   }
   AnchorPoint get_anchor_point() const {
     return anchor;
   }
 
-  void set_pos(const Vector& pos) {
-    this->pos = pos;
+  void set_pos(const Vector& pos_) {
+    this->pos = pos_;
   }
   void set_pos(float x, float y) {
     set_pos(Vector(x, y));
@@ -68,8 +68,8 @@ public:
     return pos.y;
   }
 
-  void set_anchor_point(int anchor) {
-    set_anchor_point((AnchorPoint) anchor);
+  void set_anchor_point(int anchor_) {
+    set_anchor_point((AnchorPoint) anchor_);
   }
   int get_anchor_point() {
     return (int) get_anchor_point();
index ed3d472..9136092 100644 (file)
@@ -134,8 +134,8 @@ TileMap::TileMap(const Reader& reader) :
   }
 }
 
-TileMap::TileMap(const TileSet *new_tileset, std::string name, int z_pos,
-                 bool solid, size_t width, size_t height) :
+TileMap::TileMap(const TileSet *new_tileset, std::string name_, int z_pos_,
+                 bool solid, size_t width_, size_t height_) :
   tileset(new_tileset),
   tiles(),
   real_solid(solid),
@@ -144,7 +144,7 @@ TileMap::TileMap(const TileSet *new_tileset, std::string name, int z_pos,
   speed_y(1),
   width(0),
   height(0),
-  z_pos(z_pos),
+  z_pos(z_pos_),
   offset(Vector(0,0)),
   movement(Vector(0,0)),
   drawing_effect(NO_EFFECT),
@@ -155,12 +155,12 @@ TileMap::TileMap(const TileSet *new_tileset, std::string name, int z_pos,
   walker(),
   draw_target(DrawingContext::NORMAL)
 {
-  this->name = name;
+  this->name = name_;
 
   if (this->z_pos > (LAYER_GUI - 100))
     this->z_pos = LAYER_GUI - 100;
 
-  resize(width, height);
+  resize(width_, height_);
 }
 
 TileMap::~TileMap()
@@ -416,16 +416,16 @@ TileMap::change_all(uint32_t oldtile, uint32_t newtile)
 }
 
 void
-TileMap::fade(float alpha, float seconds)
+TileMap::fade(float alpha_, float seconds)
 {
-  this->alpha = alpha;
+  this->alpha = alpha_;
   this->remaining_fade_time = seconds;
 }
 
 void
-TileMap::set_alpha(float alpha)
+TileMap::set_alpha(float alpha_)
 {
-  this->alpha = alpha;
+  this->alpha = alpha_;
   this->current_alpha = alpha;
   this->remaining_fade_time = 0;
   update_effective_solid ();
index b3af59f..ea5f3a3 100644 (file)
@@ -53,9 +53,9 @@ Wind::Wind(const Reader& reader) :
 }
 
 void
-Wind::update(float elapsed_time)
+Wind::update(float elapsed_time_)
 {
-  this->elapsed_time = elapsed_time;
+  this->elapsed_time = elapsed_time_;
 
   if (!blowing) return;
 
index c496b62..6b862b7 100644 (file)
@@ -53,8 +53,8 @@ OFileStreambuf::overflow(int c)
     return traits_type::eof();
 
   if(c != traits_type::eof()) {
-    PHYSFS_sint64 res = PHYSFS_write(file, &c2, 1, 1);
-    if(res <= 0)
+    PHYSFS_sint64 res_ = PHYSFS_write(file, &c2, 1, 1);
+    if(res_ <= 0)
       return traits_type::eof();
   }
 
index a2a180e..4491cce 100644 (file)
@@ -20,8 +20,8 @@
 #include "util/log.hpp"
 
 namespace scripting {
-Camera::Camera(::Camera* camera)
-  : camera(camera)
+Camera::Camera(::Camera* camera_)
+  : camera(camera_)
 { }
 
 Camera::~Camera()
index 018ddb5..3e4df42 100644 (file)
@@ -19,8 +19,8 @@
 
 namespace scripting {
 
-Candle::Candle(::Candle* candle)
-  : candle(candle)
+Candle::Candle(::Candle* candle_)
+  : candle(candle_)
 { }
 
 Candle::~Candle()
index e4e390e..736b6b2 100644 (file)
@@ -21,8 +21,8 @@
 
 namespace scripting {
 
-LevelTime::LevelTime(::LevelTime* level_time)
-  : level_time(level_time)
+LevelTime::LevelTime(::LevelTime* level_time_)
+  : level_time(level_time_)
 { }
 
 LevelTime::~LevelTime()
index 3908792..bbf137b 100644 (file)
@@ -21,8 +21,8 @@
 
 namespace scripting {
 
-Platform::Platform(::Platform* platform)
-  : platform(platform)
+Platform::Platform(::Platform* platform_)
+  : platform(platform_)
 { }
 
 Platform::~Platform()
index f839641..d3445cc 100644 (file)
 
 namespace scripting {
 
-SquirrelError::SquirrelError(HSQUIRRELVM v, const std::string& message) throw() :
+SquirrelError::SquirrelError(HSQUIRRELVM v, const std::string& message_) throw() :
   message()
 {
   std::ostringstream msg;
-  msg << "Squirrel error: " << message << " (";
+  msg << "Squirrel error: " << message_ << " (";
   const char* lasterr;
   sq_getlasterror(v);
   if(sq_gettype(v, -1) != OT_STRING)
index 00e927e..739f6b0 100644 (file)
@@ -20,8 +20,8 @@
 
 namespace scripting {
 
-Thunderstorm::Thunderstorm(::Thunderstorm* thunderstorm)
-  : thunderstorm(thunderstorm)
+Thunderstorm::Thunderstorm(::Thunderstorm* thunderstorm_)
+  : thunderstorm(thunderstorm_)
 {
 }
 
index 709bea2..be1799c 100644 (file)
@@ -21,8 +21,8 @@
 
 namespace scripting {
 
-TileMap::TileMap(::TileMap* tilemap)
-  : tilemap(tilemap)
+TileMap::TileMap(::TileMap* tilemap_)
+  : tilemap(tilemap_)
 { }
 
 TileMap::~TileMap()
index 32d8d5a..45d6130 100644 (file)
@@ -21,8 +21,8 @@
 
 namespace scripting {
 
-Wind::Wind(::Wind* wind)
-  : wind(wind)
+Wind::Wind(::Wind* wind_)
+  : wind(wind_)
 { }
 
 Wind::~Wind()
index b624e3f..523ffd7 100644 (file)
@@ -184,15 +184,15 @@ Console::scroll(int numLines)
 }
 
 void
-Console::show_history(int offset)
+Console::show_history(int offset_)
 {
-  while ((offset > 0) && (history_position != history.end())) {
+  while ((offset_ > 0) && (history_position != history.end())) {
     history_position++;
-    offset--;
+    offset_--;
   }
-  while ((offset < 0) && (history_position != history.begin())) {
+  while ((offset_ < 0) && (history_position != history.begin())) {
     history_position--;
-    offset++;
+    offset_++;
   }
   if (history_position == history.end()) {
     inputBuffer = "";
@@ -204,11 +204,11 @@ Console::show_history(int offset)
 }
 
 void
-Console::move_cursor(int offset)
+Console::move_cursor(int offset_)
 {
-  if (offset == -65535) inputBufferPosition = 0;
-  if (offset == +65535) inputBufferPosition = inputBuffer.length();
-  inputBufferPosition+=offset;
+  if (offset_ == -65535) inputBufferPosition = 0;
+  if (offset_ == +65535) inputBufferPosition = inputBuffer.length();
+  inputBufferPosition+=offset_;
   if (inputBufferPosition < 0) inputBufferPosition = 0;
   if (inputBufferPosition > (int)inputBuffer.length()) inputBufferPosition = inputBuffer.length();
 }
index 8259beb..b03efce 100644 (file)
@@ -18,8 +18,8 @@
 #include "supertux/globals.hpp"
 #include "video/drawing_context.hpp"
 
-FadeOut::FadeOut(float fade_time, Color color)
-  : color(color), fade_time(fade_time), accum_time(0)
+FadeOut::FadeOut(float fade_time_, Color color_)
+  : color(color_), fade_time(fade_time_), accum_time(0)
 {
 }
 
index b83453d..0e621bd 100644 (file)
@@ -266,14 +266,14 @@ GameSession::abort_level()
 }
 
 void
-GameSession::set_editmode(bool edit_mode)
+GameSession::set_editmode(bool edit_mode_)
 {
-  if (this->edit_mode == edit_mode) return;
-  this->edit_mode = edit_mode;
+  if (this->edit_mode == edit_mode_) return;
+  this->edit_mode = edit_mode_;
 
-  currentsector->get_players()[0]->set_edit_mode(edit_mode);
+  currentsector->get_players()[0]->set_edit_mode(edit_mode_);
 
-  if (edit_mode) {
+  if (edit_mode_) {
 
     // entering edit mode
 
index 77b8195..20a287c 100644 (file)
@@ -87,11 +87,11 @@ InfoBoxLine::LineType get_linetype_by_format_char(char format_char) {
 
 } // namespace
 
-InfoBoxLine::InfoBoxLine(char format_char, const std::string& text) :
+InfoBoxLine::InfoBoxLine(char format_char, const std::string& text_) :
   lineType(NORMAL),
   font(Resources::normal_font),
   color(),
-  text(text),
+  text(text_),
   image()
 {
   font = get_font_by_format_char(format_char);
index 02215f9..d20a4a7 100644 (file)
@@ -28,9 +28,9 @@
 #include <sstream>
 #include <boost/format.hpp>
 
-LevelIntro::LevelIntro(const Level* level, const Statistics* best_level_statistics) :
-  level(level),
-  best_level_statistics(best_level_statistics),
+LevelIntro::LevelIntro(const Level* level_, const Statistics* best_level_statistics_) :
+  level(level_),
+  best_level_statistics(best_level_statistics_),
   player_sprite(),
   player_sprite_py(0),
   player_sprite_vy(0),
index ddbac88..ab41bea 100644 (file)
@@ -292,9 +292,9 @@ Main::run(int argc, char** argv)
         args.merge_into(*g_config);
         init_tinygettext();
       }
-      catch(const std::exception& err)
+      catch(const std::exception& err_)
       {
-        log_fatal << "failed to init config or tinygettext: " << err.what() << std::endl;
+        log_fatal << "failed to init config or tinygettext: " << err_.what() << std::endl;
       }
 
       std::cout << "Error: " << err.what() << std::endl;
index c0991c2..7877fa8 100644 (file)
@@ -124,13 +124,16 @@ OptionsMenu::OptionsMenu(bool complete)
   }
   fullscreen_res->list.push_back("Desktop");
 
-  std::ostringstream out;
   std::string fullscreen_size_str = "Desktop";
-  if (g_config->fullscreen_size != Size(0, 0))
   {
-    out << g_config->fullscreen_size.width << "x" << g_config->fullscreen_size.height << "@" << g_config->fullscreen_refresh_rate;
-    fullscreen_size_str = out.str();
+    std::ostringstream out;
+    if (g_config->fullscreen_size != Size(0, 0))
+    {
+      out << g_config->fullscreen_size.width << "x" << g_config->fullscreen_size.height << "@" << g_config->fullscreen_refresh_rate;
+      fullscreen_size_str = out.str();
+    }
   }
+
   size_t cnt = 0;
   for (std::vector<std::string>::iterator i = fullscreen_res->list.begin(); i != fullscreen_res->list.end(); ++i)
   {
@@ -163,16 +166,16 @@ OptionsMenu::OptionsMenu(bool complete)
     std::ostringstream out;
     out << g_config->aspect_size.width << ":" << g_config->aspect_size.height;
     std::string aspect_ratio = out.str();
-    size_t cnt = 0;
+    size_t cnt_ = 0;
     for(std::vector<std::string>::iterator i = aspect->list.begin(); i != aspect->list.end(); ++i)
     {
       if(*i == aspect_ratio)
       {
         aspect_ratio.clear();
-       aspect->selected = cnt;
+       aspect->selected = cnt_;
         break;
       }
-      ++cnt;
+      ++cnt_;
     }
 
     if (!aspect_ratio.empty())
index 065e174..518e719 100644 (file)
@@ -130,9 +130,9 @@ Physic::get_acceleration() const
 }
 
 void
-Physic::enable_gravity(bool enable_gravity)
+Physic::enable_gravity(bool enable_gravity_)
 {
-  gravity_enabled_flag = enable_gravity;
+  gravity_enabled_flag = enable_gravity_;
 }
 
 bool
@@ -142,9 +142,9 @@ Physic::gravity_enabled() const
 }
 
 void
-Physic::set_gravity_modifier(float gravity_modifier)
+Physic::set_gravity_modifier(float gravity_modifier_)
 {
-  this->gravity_modifier = gravity_modifier;
+  this->gravity_modifier = gravity_modifier_;
 }
 
 Vector
index 333a737..86491e1 100644 (file)
@@ -145,37 +145,37 @@ Sector::get_level()
 }
 
 GameObject*
-Sector::parse_object(const std::string& name, const Reader& reader)
+Sector::parse_object(const std::string& name_, const Reader& reader)
 {
-  if(name == "camera") {
-    Camera* camera = new Camera(this, "Camera");
-    camera->parse(reader);
-    return camera;
-  } else if(name == "particles-snow") {
+  if(name_ == "camera") {
+    Camera* camera_ = new Camera(this, "Camera");
+    camera_->parse(reader);
+    return camera_;
+  } else if(name_ == "particles-snow") {
     SnowParticleSystem* partsys = new SnowParticleSystem();
     partsys->parse(reader);
     return partsys;
-  } else if(name == "particles-rain") {
+  } else if(name_ == "particles-rain") {
     RainParticleSystem* partsys = new RainParticleSystem();
     partsys->parse(reader);
     return partsys;
-  } else if(name == "particles-comets") {
+  } else if(name_ == "particles-comets") {
     CometParticleSystem* partsys = new CometParticleSystem();
     partsys->parse(reader);
     return partsys;
-  } else if(name == "particles-ghosts") {
+  } else if(name_ == "particles-ghosts") {
     GhostParticleSystem* partsys = new GhostParticleSystem();
     partsys->parse(reader);
     return partsys;
-  } else if(name == "particles-clouds") {
+  } else if(name_ == "particles-clouds") {
     CloudParticleSystem* partsys = new CloudParticleSystem();
     partsys->parse(reader);
     return partsys;
-  } else if(name == "money") { // for compatibility with old maps
+  } else if(name_ == "money") { // for compatibility with old maps
     return new Jumpy(reader);
   } else {
     try {
-      return ObjectFactory::instance().create(name, reader);
+      return ObjectFactory::instance().create(name_, reader);
     } catch(std::exception& e) {
       log_warning << e.what() << "" << std::endl;
       return 0;
@@ -390,8 +390,8 @@ Sector::parse_old_format(const Reader& reader)
   }
 
   // add a camera
-  Camera* camera = new Camera(this, "Camera");
-  add_object(camera);
+  Camera* camera_ = new Camera(this, "Camera");
+  add_object(camera_);
 
   update_game_objects();
 
@@ -751,31 +751,31 @@ Sector::before_object_add(GameObject* object)
     solid_tilemaps.push_back(tilemap);
   }
 
-  Camera* camera = dynamic_cast<Camera*> (object);
-  if(camera != NULL) {
+  Camera* camera_ = dynamic_cast<Camera*> (object);
+  if(camera_ != NULL) {
     if(this->camera != 0) {
       log_warning << "Multiple cameras added. Ignoring" << std::endl;
       return false;
     }
-    this->camera = camera;
+    this->camera = camera_;
   }
 
-  Player* player = dynamic_cast<Player*> (object);
-  if(player != NULL) {
+  Player* player_ = dynamic_cast<Player*> (object);
+  if(player_ != NULL) {
     if(this->player != 0) {
       log_warning << "Multiple players added. Ignoring" << std::endl;
       return false;
     }
-    this->player = player;
+    this->player = player_;
   }
 
-  DisplayEffect* effect = dynamic_cast<DisplayEffect*> (object);
-  if(effect != NULL) {
+  DisplayEffect* effect_ = dynamic_cast<DisplayEffect*> (object);
+  if(effect_ != NULL) {
     if(this->effect != 0) {
       log_warning << "Multiple DisplayEffects added. Ignoring" << std::endl;
       return false;
     }
-    this->effect = effect;
+    this->effect = effect_;
   }
 
   if(_current == this) {
@@ -1597,10 +1597,10 @@ Sector::get_ambient_blue()
 }
 
 void
-Sector::set_gravity(float gravity)
+Sector::set_gravity(float gravity_)
 {
   log_warning << "Changing a Sector's gravitational constant might have unforeseen side-effects" << std::endl;
-  this->gravity = gravity;
+  this->gravity = gravity_;
 }
 
 float
index e74a5b2..adee153 100644 (file)
@@ -18,9 +18,9 @@
 #include "supertux/shrinkfade.hpp"
 #include "video/drawing_context.hpp"
 
-ShrinkFade::ShrinkFade(const Vector& dest, float fade_time) :
-  dest(dest),
-  fade_time(fade_time),
+ShrinkFade::ShrinkFade(const Vector& dest_, float fade_time_) :
+  dest(dest_),
+  fade_time(fade_time_),
   accum_time(0),
   speedleft(),
   speedright(),
index 61a2e06..ae8f299 100644 (file)
@@ -37,14 +37,14 @@ Tile::Tile() :
 }
 
 Tile::Tile(const std::vector<ImageSpec>& imagespecs_, const std::vector<ImageSpec>& editor_imagespecs_,
-           uint32_t attributes, uint32_t data, float fps) :
+           uint32_t attributes_, uint32_t data_, float fps_) :
   imagespecs(imagespecs_),
   images(),
   editor_imagespecs(editor_imagespecs_),
   editor_images(),
-  attributes(attributes),
-  data(data),
-  fps(fps)
+  attributes(attributes_),
+  data(data_),
+  fps(fps_)
 {
   correct_attributes();
 }
index 3df088d..735e4ab 100644 (file)
@@ -30,10 +30,10 @@ Timer::~Timer()
 }
 
 void
-Timer::start(float period, bool cyclic)
+Timer::start(float period_, bool cyclic_)
 {
-  this->period = period;
-  this->cyclic = cyclic;
+  this->period = period_;
+  this->cyclic = cyclic_;
   cycle_start = game_time;
 }
 
index 3ee067c..2bb4f71 100644 (file)
@@ -130,7 +130,7 @@ Door::event(Player& , EventType type)
 }
 
 HitResponse
-Door::collision(GameObject& other, const CollisionHit& hit)
+Door::collision(GameObject& other, const CollisionHit& hit_)
 {
   switch (state) {
     case CLOSED:
@@ -159,7 +159,7 @@ Door::collision(GameObject& other, const CollisionHit& hit)
       break;
   }
 
-  return TriggerBase::collision(other, hit);
+  return TriggerBase::collision(other, hit_);
 }
 
 /* EOF */
index db1e308..439ec11 100644 (file)
@@ -47,13 +47,13 @@ ScriptTrigger::ScriptTrigger(const Reader& reader) :
     triggerevent = EVENT_TOUCH;
 }
 
-ScriptTrigger::ScriptTrigger(const Vector& pos, const std::string& script) :
+ScriptTrigger::ScriptTrigger(const Vector& pos, const std::string& script_) :
   triggerevent(),
   script()
 {
   bbox.set_pos(pos);
   bbox.set_size(32, 32);
-  this->script = script;
+  this->script = script_;
   triggerevent = EVENT_TOUCH;
 }
 
index b356430..3356099 100644 (file)
@@ -51,11 +51,11 @@ SecretAreaTrigger::SecretAreaTrigger(const Reader& reader) :
   message_displayed = false;
 }
 
-SecretAreaTrigger::SecretAreaTrigger(const Rectf& area, std::string fade_tilemap) :
+SecretAreaTrigger::SecretAreaTrigger(const Rectf& area, std::string fade_tilemap_) :
   message_timer(),
   message_displayed(),
   message(_("You found a secret area!")),
-  fade_tilemap(fade_tilemap),
+  fade_tilemap(fade_tilemap_),
   script()
 {
   bbox = area;
index 6086867..199cb2c 100644 (file)
@@ -25,8 +25,8 @@ template<typename T>
 class Ref
 {
 public:
-  Ref(T* object = 0)
-    : object(object)
+  Ref(T* object_ = 0)
+    : object(object_)
   {
     if(object)
       object->ref();
@@ -49,13 +49,13 @@ public:
     return *this;
   }
 
-  Ref<T>& operator= (T* object)
+  Ref<T>& operator= (T* object_)
   {
-    if(object)
-      object->ref();
+    if(object_)
+      object_->ref();
     if(this->object)
       this->object->unref();
-    this->object = object;
+    this->object = object_;
 
     return *this;
   }
index 3eacf3f..2351261 100644 (file)
@@ -60,9 +60,9 @@ DrawingContext::~DrawingContext()
 }
 
 void
-DrawingContext::clear_drawing_requests(DrawingRequests& requests)
+DrawingContext::clear_drawing_requests(DrawingRequests& requests_)
 {
-  for(auto& request : requests)
+  for(auto& request : requests_)
   {
     if (request->request_data)
     {
@@ -70,7 +70,7 @@ DrawingContext::clear_drawing_requests(DrawingRequests& requests)
     }
     request->~DrawingRequest();
   }
-  requests.clear();
+  requests_.clear();
 }
 
 void
@@ -357,12 +357,12 @@ public:
 };
 
 void
-DrawingContext::handle_drawing_requests(DrawingRequests& requests)
+DrawingContext::handle_drawing_requests(DrawingRequests& requests_)
 {
-  std::stable_sort(requests.begin(), requests.end(), RequestPtrCompare());
+  std::stable_sort(requests_.begin(), requests_.end(), RequestPtrCompare());
 
   DrawingRequests::const_iterator i;
-  for(i = requests.begin(); i != requests.end(); ++i) {
+  for(i = requests_.begin(); i != requests_.end(); ++i) {
     const DrawingRequest& request = **i;
 
     switch(request.target) {
@@ -487,13 +487,13 @@ DrawingContext::pop_target()
 }
 
 void
-DrawingContext::set_target(Target target)
+DrawingContext::set_target(Target target_)
 {
-  this->target = target;
-  if(target == LIGHTMAP) {
+  this->target = target_;
+  if(target_ == LIGHTMAP) {
     requests = &lightmap_requests;
   } else {
-    assert(target == NORMAL);
+    assert(target_ == NORMAL);
     requests = &drawing_requests;
   }
 }
index bc51c7e..4185445 100644 (file)
@@ -74,9 +74,9 @@ Font::Font(GlyphWidth glyph_width_,
   // scan for prefix-filename in addons search path
   char **rc = PHYSFS_enumerateFiles(fontdir.c_str());
   for (char **i = rc; *i != NULL; i++) {
-    std::string filename(*i);
-    if( filename.rfind(fontname) != std::string::npos ) {
-      loadFontFile(fontdir + filename);
+    std::string filename_(*i);
+    if( filename_.rfind(fontname) != std::string::npos ) {
+      loadFontFile(fontdir + filename_);
     }
   }
   PHYSFS_freeList(rc);
@@ -164,7 +164,7 @@ Font::loadFontSurface(
   const std::string &glyphimage,
   const std::string &shadowimage,
   const std::vector<std::string> &chars,
-  GlyphWidth glyph_width,
+  GlyphWidth glyph_width_,
   int char_width
   )
 {
@@ -180,7 +180,7 @@ Font::loadFontSurface(
 
   SDL_Surface *surface = NULL;
 
-  if( glyph_width == VARIABLE ) {
+  if( glyph_width_ == VARIABLE ) {
     //this does not work:
     // surface = ((SDL::Texture *)glyph_surface.get_texture())->get_texture();
     surface = IMG_Load_RW(get_physfs_SDLRWops("images/engine/fonts/"+glyphimage), 1);
@@ -202,7 +202,7 @@ Font::loadFontSurface(
       Glyph glyph;
       glyph.surface_idx   = surface_idx;
 
-      if( glyph_width == FIXED )
+      if( glyph_width_ == FIXED )
       {
         glyph.rect    = Rectf(x, y, x + char_width, y + char_height);
         glyph.offset  = Vector(0, 0);
index 997f709..ead77e2 100644 (file)
@@ -29,7 +29,7 @@
 
 namespace worldmap {
 
-LevelTile::LevelTile(const std::string& basedir, const Reader& lisp) :
+LevelTile::LevelTile(const std::string& basedir_, const Reader& lisp) :
   pos(),
   title(),
   solved(false),
@@ -39,7 +39,7 @@ LevelTile::LevelTile(const std::string& basedir, const Reader& lisp) :
   statistics(),
   target_time(),
   extro_script(),
-  basedir(basedir),
+  basedir(basedir_),
   picture_cached(false),
   picture(0)
 {
@@ -54,7 +54,7 @@ LevelTile::LevelTile(const std::string& basedir, const Reader& lisp) :
 
   lisp.get("extro-script", extro_script);
 
-  if (!PHYSFS_exists((basedir + name).c_str()))
+  if (!PHYSFS_exists((basedir_ + name).c_str()))
   {
     log_warning << "level file '" << name
                 << "' does not exist and will not be added to the worldmap" << std::endl;
index c76af1c..95c1c3d 100644 (file)
@@ -291,14 +291,14 @@ Tux::tryContinueWalking(float elapsed_time)
 void
 Tux::updateInputDirection()
 {
-  Controller* controller = g_input_manager->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;
 }
 
index 12ffc5d..90b5055 100644 (file)
@@ -78,7 +78,7 @@ namespace worldmap {
 
 WorldMap* WorldMap::current_ = NULL;
 
-WorldMap::WorldMap(const std::string& filename, Savegame& savegame, const std::string& force_spawnpoint) :
+WorldMap::WorldMap(const std::string& filename, Savegame& savegame, const std::string& force_spawnpoint_) :
   tux(),
   m_savegame(savegame),
   tileset(NULL),
@@ -102,7 +102,7 @@ WorldMap::WorldMap(const std::string& filename, Savegame& savegame, const std::s
   worldmap_table(),
   scripts(),
   ambient_light( 1.0f, 1.0f, 1.0f, 1.0f ),
-  force_spawnpoint(force_spawnpoint),
+  force_spawnpoint(force_spawnpoint_),
   in_level(false),
   pan_pos(),
   panning(false),
@@ -237,10 +237,10 @@ WorldMap::move_to_spawnpoint(const std::string& spawnpoint, bool pan)
 }
 
 void
-WorldMap::change(const std::string& filename, const std::string& force_spawnpoint)
+WorldMap::change(const std::string& filename, const std::string& force_spawnpoint_)
 {
   g_screen_manager->pop_screen();
-  g_screen_manager->push_screen(std::unique_ptr<Screen>(new WorldMap(filename, m_savegame, force_spawnpoint)));
+  g_screen_manager->push_screen(std::unique_ptr<Screen>(new WorldMap(filename, m_savegame, force_spawnpoint_)));
 }
 
 void
@@ -253,25 +253,25 @@ WorldMap::load(const std::string& filename)
     lisp::Parser parser;
     const lisp::Lisp* root = parser.parse(map_filename);
 
-    const lisp::Lisp* level = root->get_lisp("supertux-level");
-    if(level == NULL)
+    const lisp::Lisp* level_ = root->get_lisp("supertux-level");
+    if(level_ == NULL)
       throw std::runtime_error("file isn't a supertux-level file.");
 
-    level->get("name", name);
+    level_->get("name", name);
 
-    const lisp::Lisp* sector = level->get_lisp("sector");
+    const lisp::Lisp* sector = level_->get_lisp("sector");
     if(!sector)
       throw std::runtime_error("No sector specified in worldmap file.");
 
-    const lisp::Lisp* tilesets_lisp = level->get_lisp("tilesets");
+    const lisp::Lisp* tilesets_lisp = level_->get_lisp("tilesets");
     if(tilesets_lisp != NULL) {
       tileset      = tile_manager->parse_tileset_definition(*tilesets_lisp).release();
       free_tileset = true;
     }
     std::string tileset_name;
-    if(level->get("tileset", tileset_name)) {
+    if(level_->get("tileset", tileset_name)) {
       if(tileset != NULL) {
-        log_warning << "multiple tilesets specified in level" << std::endl;
+        log_warning << "multiple tilesets specified in level_" << std::endl;
       } else {
         tileset = tile_manager->get_tileset(tileset_name);
       }
@@ -540,11 +540,11 @@ WorldMap::finished_level(Level* gamelevel)
 
 Vector
 WorldMap::get_camera_pos_for_tux() {
-  Vector camera_offset;
+  Vector camera_offset_;
   Vector tux_pos = tux->get_pos();
-  camera_offset.x = tux_pos.x - SCREEN_WIDTH/2;
-  camera_offset.y = tux_pos.y - SCREEN_HEIGHT/2;
-  return camera_offset;
+  camera_offset_.x = tux_pos.x - SCREEN_WIDTH/2;
+  camera_offset_.y = tux_pos.y - SCREEN_HEIGHT/2;
+  return camera_offset_;
 }
 
 void
@@ -608,12 +608,12 @@ WorldMap::update(float delta)
     if(!panning) {
       camera_offset = get_camera_pos_for_tux();
     } else {
-      Vector delta = pan_pos - camera_offset;
-      float mag = delta.norm();
+      Vector delta__ = pan_pos - camera_offset;
+      float mag = delta__.norm();
       if(mag > CAMERA_PAN_SPEED) {
-        delta *= CAMERA_PAN_SPEED/mag;
+        delta__ *= CAMERA_PAN_SPEED/mag;
       }
-      camera_offset += delta;
+      camera_offset += delta__;
       if(camera_offset == pan_pos) {
         panning = false;
       }
@@ -676,8 +676,8 @@ WorldMap::update(float delta)
     if (enter_level && !tux->is_moving())
     {
       /* Check level action */
-      LevelTile* level = at_level();
-      if (!level) {
+      LevelTile* level_ = at_level();
+      if (!level_) {
         //Respawn if player on a tile with no level and nowhere to go.
         int tile_data = tile_data_at(tux->get_tile_pos());
         if(!( tile_data & ( Tile::WORLDMAP_NORTH |  Tile::WORLDMAP_SOUTH | Tile::WORLDMAP_WEST | Tile::WORLDMAP_EAST ))){
@@ -689,16 +689,16 @@ WorldMap::update(float delta)
         return;
       }
 
-      if (level->pos == tux->get_tile_pos()) {
+      if (level_->pos == tux->get_tile_pos()) {
         try {
-          Vector shrinkpos = Vector(level->pos.x*32 + 16 - camera_offset.x,
-                                    level->pos.y*32 +  8 - camera_offset.y);
-          std::string levelfile = levels_path + level->get_name();
+          Vector shrinkpos = Vector(level_->pos.x*32 + 16 - camera_offset.x,
+                                    level_->pos.y*32 +  8 - camera_offset.y);
+          std::string levelfile = levels_path + level_->get_name();
 
           // update state and savegame
           save_state();
 
-          g_screen_manager->push_screen(std::unique_ptr<Screen>(new GameSession(levelfile, m_savegame, &level->statistics)),
+          g_screen_manager->push_screen(std::unique_ptr<Screen>(new GameSession(levelfile, m_savegame, &level_->statistics)),
                                         std::unique_ptr<ScreenFade>(new ShrinkFade(shrinkpos, 1.0f)));
           in_level = true;
         } catch(std::exception& e) {