// 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 __TILEMAP_H__
-#define __TILEMAP_H__
+
+#ifndef SUPERTUX_TILEMAP_H
+#define SUPERTUX_TILEMAP_H
#include <vector>
-#include "game_object.h"
+#include <stdint.h>
+
+#include "special/game_object.h"
#include "serializable.h"
-#include "vector.h"
+#include "math/vector.h"
+
+using namespace SuperTux;
+
+namespace SuperTux {
+class LispReader;
+}
class Level;
class TileManager;
-class LispReader;
class Tile;
/**
public:
TileMap();
TileMap(LispReader& reader);
+ TileMap(int layer_, bool solid_, size_t width_, size_t height_);
virtual ~TileMap();
virtual void write(LispWriter& writer);
*/
void resize(int newwidth, int newheight);
+ /** Flip the all tile map vertically. The purpose of this is to let
+ player to play the same level in a different way :) */
+ void do_vertical_flip();
+
size_t get_width() const
{ return width; }
size_t get_height() const
{ return height; }
+
+ int get_layer() const
+ { return layer; }
bool is_solid() const
{ return solid; }
- unsigned int get_tile_id_at(const Vector& pos) const;
-
/// returns tile in row y and column y (of the tilemap)
- Tile* get_tile(int x, int y) const;
+ const Tile* get_tile(int x, int y) const;
/// returns tile at position pos (in world coordinates)
- Tile* get_tile_at(const Vector& pos) const;
+ const Tile* get_tile_at(const Vector& pos) const;
- void change(int x, int y, unsigned int newtile);
+ void change(int x, int y, uint32_t newtile);
- void change_at(const Vector& pos, unsigned int newtile);
+ void change_at(const Vector& pos, uint32_t newtile);
-public:
- std::vector<unsigned int> tiles;
+private:
+ std::vector<uint32_t> tiles;
private:
TileManager* tilemanager;
float speed;
int width, height;
int layer;
+
+ bool vertical_flip;
};
-#endif
+#endif /*SUPERTUX_TILEMAP_H*/