diff options
author | Stijn Buys <ingar@osirion.org> | 2008-03-23 18:12:56 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-03-23 18:12:56 +0000 |
commit | 22e136d88817b64ec904a7e7232a2cf9e80e74bd (patch) | |
tree | ea369bba78930ff55325412760d14102d326f85b /src/client/view.cc | |
parent | 8485d43feca5597c4b412c6912aadcd9586e3cde (diff) |
improved network connection handling, keep alive and time out
Diffstat (limited to 'src/client/view.cc')
-rw-r--r-- | src/client/view.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/view.cc b/src/client/view.cc index 5d14992..15b8606 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -146,10 +146,12 @@ void draw_status() // print stats if desired if (render::r_drawstats && render::r_drawstats->value()) { std::stringstream stats; - stats << "fps " << std::setw(6) << fps << "\n"; - stats << "tris " << std::setw(6) << render::Stats::tris << "\n"; - stats << "spheres " << std::setw(4) << render::Stats::spheres << "\n"; - draw_text(video::width-CHARWIDTH*13, CHARHEIGHT*3, stats); + stats << "fps " << std::setw(6) << fps << "\n"; + if (core::application()->connected()) { + stats << "tris " << std::setw(6) << render::Stats::tris << "\n"; + stats << "spheres " << std::setw(3) << render::Stats::spheres << "\n"; + } + draw_text(video::width-CHARWIDTH*12, CHARHEIGHT*2, stats); } // print the version number in the upper right corner @@ -161,10 +163,9 @@ void draw_status() // draw notifications gl::color(1.0f, 1.0f, 1.0f, 1.0f); size_t n = console::notify_pos % MAXNOTIFYLINES; - float now = sys::time(); int h = 4 + CHARHEIGHT; for (size_t l = 0; l < MAXNOTIFYLINES; l++) { - if (console::notify_text[n].size() > 2 && console::notify_time[n] + 4 > now) { + if (console::notify_text[n].size() > 2 && console::notify_time[n] + 4 > core::application()->time()) { if (console::notify_text[n][0] == '?') gl::color(0.7f,0.7f,0.7f, 1.0f); else if (console::notify_text[n][0] == '*') |