added castledoor background, worked on door entry level, added small clover to doodads
[supertux.git] / src / tile.cpp
index f2ec18a..0712dcd 100644 (file)
@@ -36,6 +36,12 @@ Tile::Tile()
 {
 }
 
+Tile::Tile(unsigned int id_, Uint32 attributes_, const ImageSpec& imagespec)
+  : id(id_), editor_image(0), attributes(attributes_), data(0), anim_fps(1)
+{
+  imagespecs.push_back(imagespec);
+}
+
 Tile::~Tile()
 {
   for(std::vector<Surface*>::iterator i = images.begin(); i != images.end();
@@ -52,7 +58,7 @@ Tile::parse(const lisp::Lisp& reader)
     throw std::runtime_error("Missing tile-id.");
   }
   
-  bool value;
+  bool value = false;
   if(reader.get("solid", value) && value)
     attributes |= SOLID;
   if(reader.get("unisolid", value) && value)
@@ -63,8 +69,8 @@ Tile::parse(const lisp::Lisp& reader)
     attributes |= ICE;
   if(reader.get("water", value) && value)
     attributes |= WATER;
-  if(reader.get("spike", value) && value)
-    attributes |= SPIKE;
+  if(reader.get("hurts", value) && value)
+    attributes |= HURTS;
   if(reader.get("fullbox", value) && value)
     attributes |= FULLBOX;
   if(reader.get("coin", value) && value)
@@ -111,7 +117,7 @@ Tile::parse_images(const lisp::Lisp& images_lisp)
       const lisp::Lisp* ptr = cur->get_cdr();
 
       std::string file;
-      float x, y, w, h;
+      float x = 0, y = 0, w = 0, h = 0;
       ptr->get_car()->get(file); ptr = ptr->get_cdr();
       ptr->get_car()->get(x); ptr = ptr->get_cdr();
       ptr->get_car()->get(y); ptr = ptr->get_cdr();