Skip to content

Commit

Permalink
Fix events
Browse files Browse the repository at this point in the history
  • Loading branch information
johnBuffer committed Jan 1, 2021
1 parent 4879b2c commit e1ead5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/display_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ void DisplayManager::processEvents()
{
switch (event.type)
{
case sf::Event::Closed:
m_window.close();
break;
case sf::Event::KeyPressed:
if (event.type == sf::Event::Closed) m_window.close();
if (event.key.code == sf::Keyboard::Escape) m_window.close();
else if ((event.key.code == sf::Keyboard::Subtract)) zoom(0.8f);
else if ((event.key.code == sf::Keyboard::Add)) zoom(1.2f);
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int main()
Conf<>::loadTextures();

World world(Conf<>::WIN_WIDTH, Conf<>::WIN_HEIGHT);
Colony colony(800, 450, 512);
Colony colony(Conf<>::WIN_WIDTH/2, Conf<>::WIN_HEIGHT/2, 512);
world.addMarker(Marker(colony.position, Marker::ToHome, 10.0f, true));

DisplayManager display_manager(window, window, world, colony);
Expand Down

0 comments on commit e1ead5e

Please sign in to comment.