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>2008-12-26 12:21:48 +0000
committerStijn Buys <ingar@osirion.org>2008-12-26 12:21:48 +0000
commitb875124824794a7762414db76ed9f953b8ba320f (patch)
tree86f27d64e4a9e91a93cb4b30752f27eeec6526ac /src/render
parentbfa10f9990a8a045b03474d11af75984c12a856a (diff)
default player settings in player.ini,
palette text colors, cleanups
Diffstat (limited to 'src/render')
-rw-r--r--src/render/text.cc14
-rw-r--r--src/render/text.h3
2 files changed, 12 insertions, 5 deletions
diff --git a/src/render/text.cc b/src/render/text.cc
index 127605b..f4b75c4 100644
--- a/src/render/text.cc
+++ b/src/render/text.cc
@@ -62,6 +62,15 @@ void Text::shutdown()
}
}
+void Text::assign_color(const char c, const math::Color &color)
+{
+ if (('A' <= c) && (c <= 'Z')) {
+ core_color[(size_t) (c - 'A')]->assign(color);
+ } else if (('0' <= c) && (c <= '9')) {
+ base_color[(size_t) (c - '0')]->assign(color);
+ }
+}
+
void Text::setcolor(const char color)
{
if (('A' <= color) && (color <= 'Z')) {
@@ -71,11 +80,6 @@ void Text::setcolor(const char color)
else if (('0' <= color) && (color <= '9')) {
gl::color(*base_color[(size_t) (color - '0')]);
}
-
- else {
- gl::color(1, 1, 1);
- }
-
}
void Text::setfont(const char *texture, float width, float height)
diff --git a/src/render/text.h b/src/render/text.h
index 5cf18ea..4762639 100644
--- a/src/render/text.h
+++ b/src/render/text.h
@@ -23,6 +23,9 @@ public:
static void shutdown();
+ /// assign system colors
+ static void assign_color(const char c, const math::Color &color);
+
/// draw a text string
static void draw(float x, float y, const std::string & text);