From 9628c2c097b10f22aafd4890ab8e98375b5740da Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Tue, 19 Dec 2017 22:21:17 +0100 Subject: Replace clock_gettime with std::chrono. --- src/game/interface.cpp | 6 +++--- src/game/text.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/game') diff --git a/src/game/interface.cpp b/src/game/interface.cpp index 5e5dc70..1300e95 100644 --- a/src/game/interface.cpp +++ b/src/game/interface.cpp @@ -247,13 +247,13 @@ void state_t::render_to(render::state_t *render) ss << render->stats.entities; render->render_text(x, em, ss.str(), render::ALIGN_LEFT_TOP, sf::Color::White); - perf_hist_index = (perf_hist_index + 1) % count(perf_hist); + perf_hist_index = (perf_hist_index + 1) % COUNT(perf_hist); perf_hist[perf_hist_index] = 1.0 / render->dt; fps = 0.0; - for (size_t i = 0; i < count(perf_hist); i++) + for (size_t i = 0; i < COUNT(perf_hist); i++) fps += perf_hist[i]; - fps /= count(perf_hist); + fps /= COUNT(perf_hist); x[1] += em; ss.str(std::string()); diff --git a/src/game/text.cpp b/src/game/text.cpp index 6f684f0..b9cdd32 100644 --- a/src/game/text.cpp +++ b/src/game/text.cpp @@ -66,7 +66,7 @@ static std::string get_english(index_t index) return "Spider"; case UNIT_NAME_SOLDIER: - return soldier_names[rand() % count(soldier_names)]; + return soldier_names[rand() % COUNT(soldier_names)]; case UNIT_NAME_NEST: return "Nest"; @@ -144,7 +144,7 @@ static std::string get_polish(index_t index) return "Pająk"; case UNIT_NAME_SOLDIER: - return soldier_names[rand() % count(soldier_names)]; + return soldier_names[rand() % COUNT(soldier_names)]; case UNIT_NAME_NEST: return "Gniazdo"; -- cgit