fix cr/lfs and remove trailing whitespaces...
[supertux.git] / src / object / tilemap.hpp
index 8219623..cb87573 100644 (file)
@@ -1,7 +1,7 @@
 //  $Id$
 //
-//  SuperTux -  A Jump'n Run
-//  Copyright (C) 2004 Matthias Braun <matze@braunis.de
+//  SuperTux
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
 #ifndef SUPERTUX_TILEMAP_H
 #define SUPERTUX_TILEMAP_H
 
 #include <vector>
 #include <stdint.h>
+#include <string>
 
 #include "game_object.hpp"
 #include "serializable.hpp"
@@ -43,7 +45,7 @@ class TileMap : public GameObject, public Serializable
 public:
   TileMap();
   TileMap(const lisp::Lisp& reader, TileManager* tile_manager = 0);
-  TileMap(int layer_, bool solid_, size_t width_, size_t height_);
+  TileMap(std::string name, int z_pos, bool solid_, size_t width_, size_t height_);
   virtual ~TileMap();
 
   virtual void write(lisp::Writer& writer);
@@ -52,7 +54,7 @@ public:
   virtual void draw(DrawingContext& context);
 
   void set(int width, int height, const std::vector<unsigned int>& vec,
-      int layer, bool solid);
+      int z_pos, bool solid);
 
   /** resizes the tilemap to a new width and height (tries to not destroy the
    * existing map)
@@ -65,9 +67,21 @@ public:
   size_t get_height() const
   { return height; }
 
+  float get_x_offset() const
+  { return x_offset; }
+
+  float get_y_offset() const
+  { return y_offset; }
+
+  void set_x_offset(float x_offset)
+  { this->x_offset = x_offset; }
+
+  void set_y_offset(float y_offset)
+  { this->y_offset = y_offset; }
+
   int get_layer() const
-  { return layer; }
-  
+  { return z_pos; }
+
   bool is_solid() const
   { return solid; }
 
@@ -101,16 +115,18 @@ public:
 private:
   typedef std::vector<uint32_t> Tiles;
   Tiles tiles;
-  
+
 private:
   TileManager* tilemanager;
+  std::string name;
   bool solid;
   float speed;
   int width, height;
-  int layer;
+  int z_pos;
+  float x_offset;
+  float y_offset;
 
   DrawingEffect drawing_effect;
 };
 
 #endif /*SUPERTUX_TILEMAP_H*/
-