X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftilemap.h;h=8aa2b481a21f6a772d10d841ace1e101c680ac75;hb=f41a5719a2dc1a50674c69fa511c38a152cc4b03;hp=3df34cb9aafa2733abbfcb15f203ef62342a71b8;hpb=055fb8d0e2d75acff6185f5a4f5c75e0782503c5;p=supertux.git diff --git a/src/tilemap.h b/src/tilemap.h index 3df34cb9a..8aa2b481a 100644 --- a/src/tilemap.h +++ b/src/tilemap.h @@ -21,25 +21,22 @@ #define SUPERTUX_TILEMAP_H #include +#include -#include "game_object.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; -struct TileId -{ - TileId() : id(0), hidden(0) {} - explicit TileId(unsigned int i, bool hidden_ = false) : id(i), hidden(hidden_) {} - - unsigned id :31; - unsigned hidden :1; -}; - /** * This class is reponsible for drawing the level tiles */ @@ -80,19 +77,17 @@ public: bool is_solid() const { return solid; } - TileId& get_tile_id_at(const Vector& pos); - /// 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); private: - std::vector tiles; + std::vector tiles; private: TileManager* tilemanager;