diff options
Diffstat (limited to 'src/render/text.cc')
-rw-r--r-- | src/render/text.cc | 14 |
1 files changed, 9 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) |