Skip to content

Commit e1ead5e

Browse files
committed
Fix events
1 parent 4879b2c commit e1ead5e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/display_manager.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ void DisplayManager::processEvents()
8484
{
8585
switch (event.type)
8686
{
87+
case sf::Event::Closed:
88+
m_window.close();
89+
break;
8790
case sf::Event::KeyPressed:
88-
if (event.type == sf::Event::Closed) m_window.close();
8991
if (event.key.code == sf::Keyboard::Escape) m_window.close();
9092
else if ((event.key.code == sf::Keyboard::Subtract)) zoom(0.8f);
9193
else if ((event.key.code == sf::Keyboard::Add)) zoom(1.2f);

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ int main()
1616
Conf<>::loadTextures();
1717

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

2222
DisplayManager display_manager(window, window, world, colony);

0 commit comments

Comments
 (0)