summaryrefslogtreecommitdiff
path: root/src/game/interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/interface.cpp')
-rw-r--r--src/game/interface.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/game/interface.cpp b/src/game/interface.cpp
index 7697a22..262c3ae 100644
--- a/src/game/interface.cpp
+++ b/src/game/interface.cpp
@@ -160,11 +160,13 @@ void state_t::tick(double dt)
case sf::Event::KeyPressed:
switch (event.key.code) {
case sf::Keyboard::Key::Space:
- game->paused ^= 1;
- if (game->paused)
+ if (!game->paused) {
+ game->pause();
print(text::get(text::PAUSED));
- else
+ } else {
+ game->resume();
print(text::get(text::UNPAUSED));
+ }
break;
case sf::Keyboard::Key::F:
@@ -239,7 +241,7 @@ void state_t::render_to(render::state_t *render)
x[1] += em;
}
- x = v2f_t(0.0f, h - em * 4.5);
+ x = v2f_t(0.0f, h - em * 5.5);
ss << "World S/T:";
ss << game->world.stats.sectors << "/";
ss << game->world.stats.tiles;
@@ -271,6 +273,12 @@ void state_t::render_to(render::state_t *render)
ss << std::fixed << std::setprecision(1);
ss << "FPS: " << fps;
render->render_text(x, em, ss.str(), render::ALIGN_LEFT_TOP, sf::Color::White);
+
+ x[1] += em;
+ ss.str(std::string());
+ ss << std::fixed << std::setprecision(3);
+ ss << "Game t/F/B: " << game->time * 1.0e-9 << "/" << game->frames << "/" << game->frames_behind;
+ render->render_text(x, em, ss.str(), render::ALIGN_LEFT_TOP, sf::Color::White);
}
} // namespace interface