projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed broken 1-time animations in sprites, fixed collision code returning no-collisio...
[supertux.git]
/
src
/
tilemap.h
diff --git
a/src/tilemap.h
b/src/tilemap.h
index
18340aa
..
8aa2b48
100644
(file)
--- a/
src/tilemap.h
+++ b/
src/tilemap.h
@@
-21,14
+21,20
@@
#define SUPERTUX_TILEMAP_H
#include <vector>
#define SUPERTUX_TILEMAP_H
#include <vector>
+#include <stdint.h>
-#include "game_object.h"
+#include "
special/
game_object.h"
#include "serializable.h"
#include "serializable.h"
-#include "vector.h"
+#include "math/vector.h"
+
+using namespace SuperTux;
+
+namespace SuperTux {
+class LispReader;
+}
class Level;
class TileManager;
class Level;
class TileManager;
-class LispReader;
class Tile;
/**
class Tile;
/**
@@
-39,6
+45,7
@@
class TileMap : public GameObject, public Serializable
public:
TileMap();
TileMap(LispReader& reader);
public:
TileMap();
TileMap(LispReader& reader);
+ TileMap(int layer_, bool solid_, size_t width_, size_t height_);
virtual ~TileMap();
virtual void write(LispWriter& writer);
virtual ~TileMap();
virtual void write(LispWriter& writer);
@@
-54,28
+61,33
@@
public:
*/
void resize(int newwidth, int newheight);
*/
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; }
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; }
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)
/// 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)
/// 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, u
nsigned in
t newtile);
+ void change(int x, int y, u
int32_
t newtile);
- void change_at(const Vector& pos, u
nsigned in
t newtile);
+ void change_at(const Vector& pos, u
int32_
t newtile);
-p
ublic
:
- std::vector<u
nsigned in
t> tiles;
+p
rivate
:
+ std::vector<u
int32_
t> tiles;
private:
TileManager* tilemanager;
private:
TileManager* tilemanager;
@@
-83,6
+95,8
@@
private:
float speed;
int width, height;
int layer;
float speed;
int width, height;
int layer;
+
+ bool vertical_flip;
};
#endif /*SUPERTUX_TILEMAP_H*/
};
#endif /*SUPERTUX_TILEMAP_H*/