diff options
author | zedarider <ymherklotz@gmail.com> | 2016-12-07 17:44:30 +0000 |
---|---|---|
committer | zedarider <ymherklotz@gmail.com> | 2016-12-07 17:44:30 +0000 |
commit | dce13d7a63ecf8e2c0ceb4df5a13eee4f0849350 (patch) | |
tree | fb302eb5c409cf4d986adf57ce54ae43bb1f7b54 /include | |
parent | 1c8f5fa033cf11504b6368a71d05d1d4eb1e83fd (diff) | |
download | A-star-algorithm-dce13d7a63ecf8e2c0ceb4df5a13eee4f0849350.tar.gz A-star-algorithm-dce13d7a63ecf8e2c0ceb4df5a13eee4f0849350.zip |
adding comments
Diffstat (limited to 'include')
-rw-r--r-- | include/TileMap.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/TileMap.hpp b/include/TileMap.hpp index e461c52..e47bb22 100644 --- a/include/TileMap.hpp +++ b/include/TileMap.hpp @@ -1,3 +1,6 @@ +// Tile map class that creates vertices to form a grid full of +// squares and adds texture to it. + #ifndef TILEMAP_HPP #define TILEMAP_HPP @@ -10,11 +13,19 @@ public: TileMap(); ~TileMap(); + // loads the text file and then creates the vertex array and the assigns + // the texture to the vertex array. It also therefore defines the size + // of the grid. bool load(const std::string& txt_file, const sf::Vector2f& txt_size, const sf::Vector2f& tile_size, const int *tiles, unsigned int width, unsigned int height); private: + // private function draw that overwrites the draw function in the + // Drawable function. This draws all the vertices to the window. virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const; + // vertex array that contains all the vertices. sf::VertexArray m_vertices; + // texture that will be loaded onto the vertices. This will be associated + // to the vertices. sf::Texture m_texture; }; |