diff options
author | Nao Pross <naopross@thearcway.org> | 2018-02-11 22:55:22 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-02-11 22:55:22 +0100 |
commit | e3fd07e606098dd9cdf0b7ed806340d8466b5572 (patch) | |
tree | cbf5cc81afcbbc62784f7c6fc02d4418cf03cee7 /src/main/cpp/WorldScene.cpp | |
parent | Remove redundant scenesOffsetX/Y, replaced with panX (diff) | |
download | Subconscious-old-e3fd07e606098dd9cdf0b7ed806340d8466b5572.tar.gz Subconscious-old-e3fd07e606098dd9cdf0b7ed806340d8466b5572.zip |
Reimplement in C++ with SFML (mostly)
Diffstat (limited to 'src/main/cpp/WorldScene.cpp')
-rw-r--r-- | src/main/cpp/WorldScene.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/cpp/WorldScene.cpp b/src/main/cpp/WorldScene.cpp new file mode 100644 index 0000000..ab1c4d0 --- /dev/null +++ b/src/main/cpp/WorldScene.cpp @@ -0,0 +1,28 @@ +#include "WorldScene.hpp" + +WorldScene::WorldScene() +{ + _tileSize = DEFAULT_TILE_SIZE_PX; +} + +void WorldScene::render(sf::RenderWindow &window) +{ + sf::RectangleShape rect; + + rect.setSize(sf::Vector2f(_tileSize, _tileSize)); + rect.setFillColor(sf::Color::Green); + + rect.setOutlineThickness(-.5); + rect.setOutlineColor(sf::Color::Black); + + for (const Tile &tile : map.tiles()) { + rect.setPosition(tile.x * _tileSize, tile.y * _tileSize); + window.draw(rect); + } +} + +void WorldScene::zoom(int value) +{} + +void WorldScene::pan(int dx, int dy) +{} |