diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-10-09 19:24:08 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-10-09 19:24:08 +0200 |
commit | 8d6cb03cd83b9f6576909058601af54f16c8acfe (patch) | |
tree | 1aae264859680e888c5801f279b638cefa137fb9 /src/interface.cpp | |
parent | 9e7d64d052eabcf40d85c3e903aaba44903a380a (diff) |
Refactoring and basic map generation.
Diffstat (limited to 'src/interface.cpp')
-rw-r--r-- | src/interface.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/interface.cpp b/src/interface.cpp index aacc4b0..16fc77d 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -2,10 +2,10 @@ namespace interface { -state_t::state_t(sf::RenderWindow *window_, world::world_t *world_) +state_t::state_t(sf::RenderWindow *window_, game::state_t *game_) { window = window_; - world = world_; + game = game_; } static sf::Vector2f compute_drag(sf::RenderWindow *window, sf::Vector2f drag_ref) @@ -48,12 +48,6 @@ void state_t::tick(void) return; case sf::Event::MouseButtonPressed: - if (event.mouseButton.button == 0) { - sf::Vector2f vmouse = window->mapPixelToCoords( - sf::Vector2i(event.mouseButton.x, - event.mouseButton.y)); - world->get_tile(vmouse.x, vmouse.y)->type = 0; - } if (event.mouseButton.button == 1) { camera.dragging = true; camera.drag_ref = window->mapPixelToCoords( |