Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-09-19 19:44:13 +0000
committerStijn Buys <ingar@osirion.org>2010-09-19 19:44:13 +0000
commitcc18095cded14f5e7e3f049e47fca2224134b647 (patch)
tree2a057f4836925083a19988d571dc0664925c9e48 /src/client/infowidget.cc
parentbadfb31888a6bd62e0a019b3f3dec517df4121ec (diff)
text rendering cleanups, inventory capacity & cargo volume
Diffstat (limited to 'src/client/infowidget.cc')
-rw-r--r--src/client/infowidget.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/client/infowidget.cc b/src/client/infowidget.cc
index 3081b8d..c4c85a1 100644
--- a/src/client/infowidget.cc
+++ b/src/client/infowidget.cc
@@ -25,7 +25,8 @@
namespace client
{
-void time_to_stream(std::stringstream &str, float time)
+// helper function
+void time_to_stream(std::ostringstream &str, float time)
{
int minutes = (int) floorf(time / 60.0f);
int seconds = (int) floorf(time - (float) minutes * 60.0f);
@@ -43,7 +44,7 @@ DevInfoWidget::DevInfoWidget(ui::Widget *parent) : ui::Widget(parent)
void DevInfoWidget::draw()
{
- std::stringstream textstream;
+ std::ostringstream textstream;
const core::Entity *target = targets::current();
float d = 0;
@@ -71,8 +72,8 @@ void DevInfoWidget::draw()
}
}
- ui::paint::color(palette()->foreground());
- ui::paint::text(global_location(), size(), font(), textstream);
+ ui::Paint::set_color(palette()->foreground());
+ ui::Paint::draw_text(global_location(), font(), textstream.str());
}
/* -- StatsInfoWidget ---------------------------------------------- */
@@ -109,7 +110,7 @@ void StatsInfoWidget::draw()
fps = roundf(((float) fps_counter_size ) / t);
}
- std::stringstream textstream;
+ std::ostringstream textstream;
if (core::game()) {
textstream << "^Ntime ^B";
@@ -140,8 +141,8 @@ void StatsInfoWidget::draw()
}
}
- ui::paint::color(palette()->foreground());
- ui::paint::text(global_location(), size(), font(), textstream);
+ ui::Paint::set_color(palette()->foreground());
+ ui::Paint::draw_text(global_location(), font(), textstream.str());
}
/* -- KeyInfoWidget ------------------------------------------------ */
@@ -155,10 +156,9 @@ KeyInfoWidget::KeyInfoWidget(ui::Widget *parent) : Widget(parent)
void KeyInfoWidget::draw()
{
- std::string label;
- ui::paint::color(palette()->highlight());
-
Key::Modifier mod = input::modifier();
+ std::string label;
+
if (mod != Key::None) {
if (mod == Key::Shift)
label.assign("shift+");
@@ -172,8 +172,10 @@ void KeyInfoWidget::draw()
label.append(input::last_key_pressed()->name());
}
- if (label.size())
- ui::paint::label(global_location(), size(), font(), label , ui::AlignCenter);
+ if (label.size()) {
+ ui::Paint::set_color(palette()->highlight());
+ ui::Paint::draw_label(global_location(), size(), font(), label , ui::AlignCenter);
+ }
}
}