Don't clear the keymap when loading from file so that the default config is preserved
[supertux.git] / src / object / tilemap.cpp
index 23b3fee..9136092 100644 (file)
 #include "util/reader.hpp"
 
 TileMap::TileMap(const TileSet *new_tileset) :
-  tileset(new_tileset), 
+  tileset(new_tileset),
   tiles(),
   real_solid(false),
   effective_solid(false),
-  speed_x(1), 
-  speed_y(1), 
+  speed_x(1),
+  speed_y(1),
   width(0),
-  height(0), 
-  z_pos(0), 
+  height(0),
+  z_pos(0),
   offset(Vector(0,0)),
   movement(0,0),
   drawing_effect(NO_EFFECT),
-  alpha(1.0), 
+  alpha(1.0),
   current_alpha(1.0),
   remaining_fade_time(0),
   path(),
@@ -52,16 +52,16 @@ TileMap::TileMap(const Reader& reader) :
   tiles(),
   real_solid(false),
   effective_solid(false),
-  speed_x(1), 
-  speed_y(1), 
+  speed_x(1),
+  speed_y(1),
   width(-1),
-  height(-1), 
-  z_pos(0), 
+  height(-1),
+  z_pos(0),
   offset(Vector(0,0)),
-  movement(Vector(0,0)), 
+  movement(Vector(0,0)),
   drawing_effect(NO_EFFECT),
-  alpha(1.0), 
-  current_alpha(1.0), 
+  alpha(1.0),
+  current_alpha(1.0),
   remaining_fade_time(0),
   path(),
   walker(),
@@ -76,7 +76,7 @@ TileMap::TileMap(const Reader& reader) :
   reader.get("speed-y", speed_y);
 
   z_pos = reader_get_layer (reader, /* default = */ 0);
-  
+
   if(real_solid && ((speed_x != 1) || (speed_y != 1))) {
     log_warning << "Speed of solid tilemap is not 1. fixing" << std::endl;
     speed_x = 1;
@@ -129,36 +129,38 @@ TileMap::TileMap(const Reader& reader) :
   }
 
   if(empty)
+  {
     log_info << "Tilemap '" << name << "', z-pos '" << z_pos << "' is empty." << std::endl;
+  }
 }
 
-TileMap::TileMap(const TileSet *new_tileset, std::string name, int z_pos,
-                 bool solid, size_t width, size_t height) :
-  tileset(new_tileset), 
+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),
   effective_solid(solid),
-  speed_x(1), 
-  speed_y(1), 
+  speed_x(1),
+  speed_y(1),
   width(0),
-  height(0), 
-  z_pos(z_pos), 
+  height(0),
+  z_pos(z_pos_),
   offset(Vector(0,0)),
   movement(Vector(0,0)),
-  drawing_effect(NO_EFFECT), 
-  alpha(1.0), 
+  drawing_effect(NO_EFFECT),
+  alpha(1.0),
   current_alpha(1.0),
-  remaining_fade_time(0), 
+  remaining_fade_time(0),
   path(),
   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()
@@ -414,27 +416,27 @@ 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)
+void
+TileMap::set_alpha(float alpha_)
 {
-  this->alpha = alpha;
+  this->alpha = alpha_;
   this->current_alpha = alpha;
   this->remaining_fade_time = 0;
   update_effective_solid ();
 }
 
-float 
+float
 TileMap::get_alpha()
 {
   return this->current_alpha;
 }
+
 /*
  * Private methods
  */