From 91d3a0352088611d3b78d3344b7a2bf2d4955a0a Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 6 May 2008 21:07:11 +0000 Subject: client-side frame interpolation: frames and timers --- src/client/view.cc | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/client/view.cc') diff --git a/src/client/view.cc b/src/client/view.cc index 660930b..488a1cb 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -132,19 +132,18 @@ void draw_status() gl::color(1.0f, 1.0f, 1.0f, 1.0f); std::stringstream status; - int hours = (int) sys::time() / 3600; - int minutes = (int)(sys::time() - 3600*hours) / 60; - int seconds = (int)(sys::time() - 3600*hours - 60 *minutes); - status << "clock " << std::setfill('0') << std::setw(2) << hours << ":" - << std::setfill('0') << std::setw(2) << minutes << ":" - << std::setfill('0') << std::setw(2) << seconds; - - minutes = (int) floorf(core::application()->time() / 60.0f); - seconds = (int) floorf(core::application()->time() - (float) minutes* 60.0f); - - status << " time " << std::setfill('0') << std::setw(2) << minutes << ":" << std::setfill('0') << std::setw(2) << seconds; + /* + int minutes = (int) floorf(core::application()->time() / 60.0f); + int seconds = (int) floorf(core::application()->time() - (float) minutes* 60.0f); + */ + + if (core::game()) { + int minutes = (int) floorf(core::game()->clientframetime() / 60.0f); + int seconds = (int) floorf( core::game()->clientframetime() - (float) minutes* 60.0f); - draw_text(CHARWIDTH, 4, status); + status << " time " << std::setfill('0') << std::setw(2) << minutes << ":" << std::setfill('0') << std::setw(2) << seconds; + draw_text(CHARWIDTH, 4, status); + } // print stats if desired if (draw_stats && draw_stats->value()) { -- cgit v1.2.3