From f030154fe727e25a2afe1f78b3998c2d2dba95e4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 18 Aug 2009 09:24:15 +0000 Subject: astyle cleanup, corrects not loading of material textures --- src/client/infowidget.cc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/client/infowidget.cc') diff --git a/src/client/infowidget.cc b/src/client/infowidget.cc index b30dfd7..da4103f 100644 --- a/src/client/infowidget.cc +++ b/src/client/infowidget.cc @@ -1,7 +1,7 @@ /* client/infowidget.cc - This file is part of the Osirion project and is distributed under - the terms and conditions of the GNU General Public License version 2 + This file is part of the Osirion project and is distributed under + the terms and conditions of the GNU General Public License version 2 */ #include @@ -28,7 +28,7 @@ namespace client void time_to_stream(std::stringstream &str, float time) { int minutes = (int) floorf(time / 60.0f); - int seconds = (int) floorf( time - (float) minutes* 60.0f); + int seconds = (int) floorf(time - (float) minutes * 60.0f); str << std::setfill(' ') << std::setw(4) << minutes << ":" << std::setfill('0') << std::setw(2) << seconds; } @@ -58,19 +58,19 @@ void DevInfoWidget::draw() if (core::localcontrol()) { textstream << std::fixed << std::setprecision(2) - << "^Nx ^B" << core::localcontrol()->location().x() << " " - << "^Ny ^B" << core::localcontrol()->location().y() << " " - << "^Nz ^B" << core::localcontrol()->location().z() << '\n'; + << "^Nx ^B" << core::localcontrol()->location().x() << " " + << "^Ny ^B" << core::localcontrol()->location().y() << " " + << "^Nz ^B" << core::localcontrol()->location().z() << '\n'; textstream << "^Nthurst ^B" << core::localcontrol()->thrust() << " " - << "^Nspeed ^B" << core::localcontrol()->speed() << '\n'; - + << "^Nspeed ^B" << core::localcontrol()->speed() << '\n'; + if (target) { d = math::distance(core::localcontrol()->location(), target->location()) - target->radius() - core::localcontrol()->radius(); textstream << "^Ndist ^B" << d << '\n'; } } - + ui::paint::color(palette()->foreground()); ui::paint::text(global_location(), size(), font(), textstream); } @@ -84,7 +84,7 @@ StatsInfoWidget::StatsInfoWidget(ui::Widget *parent) : ui::Widget(parent) set_background(false); // clear counters - for (size_t i =0; i < fps_counter_size; i++) + for (size_t i = 0; i < fps_counter_size; i++) fps_counter_time[i] = 0.0f; for (size_t i = 0; i < net_counter_size; i++) @@ -98,9 +98,9 @@ void StatsInfoWidget::draw() { // average fps fps_counter_time[fps_counter_index] = core::application()->time(); - fps_counter_index = (fps_counter_index + 1 ) % fps_counter_size; + fps_counter_index = (fps_counter_index + 1) % fps_counter_size; float min_time = core::application()->time(); - for (size_t i=0; i < fps_counter_size; i++) + for (size_t i = 0; i < fps_counter_size; i++) if (fps_counter_time[i] < min_time) min_time = fps_counter_time[i]; float fps = 0.0f; @@ -135,7 +135,7 @@ void StatsInfoWidget::draw() float d = net_counter_time[index_max] - net_counter_time[index_min]; if (d > 0) { float traffic = net_counter_traffic[index_max] - net_counter_traffic[index_min]; - textstream << "^Nnet ^B" << std::setw(6) << roundf( (float) traffic / d ) << "\n"; + textstream << "^Nnet ^B" << std::setw(6) << roundf((float) traffic / d) << "\n"; } } } @@ -157,7 +157,7 @@ void KeyInfoWidget::draw() { std::string label; ui::paint::color(palette()->highlight()); - + Key::Modifier mod = input::modifier(); if (mod != Key::None) { if (mod == Key::Shift) @@ -168,7 +168,7 @@ void KeyInfoWidget::draw() label.assign("alt+"); } - if(input::last_key_pressed()) { + if (input::last_key_pressed()) { label.append(input::last_key_pressed()->name()); } -- cgit v1.2.3