summaryrefslogtreecommitdiff
path: root/src/render.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-14 18:05:51 +0100
committerPaweł Redman <pawel.redman@gmail.com>2017-12-14 18:05:51 +0100
commit5835b156f57ec4778521c013f813d1223c7fd2f6 (patch)
tree1e5fe9fc7411743988790244689848bd3073a05d /src/render.cpp
parent0e27aac4f124efcd495469522706df8cc1ca5986 (diff)
Avoid reinventing UTF-8.
Diffstat (limited to 'src/render.cpp')
-rw-r--r--src/render.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/render.cpp b/src/render.cpp
index c4718bf..d852b24 100644
--- a/src/render.cpp
+++ b/src/render.cpp
@@ -185,9 +185,7 @@ void state_t::render(oriented_sprite_t *sprite, rectf_t bounds, float angle)
void state_t::render_text(v2f_t x, float height, std::string str,
text_align_t align, sf::Color color)
{
- wchar_t buffer[4096];
- utf8_to_wchar(buffer, sizeof(buffer) / sizeof(wchar_t), str);
- sf::Text text(buffer, font, 40);
+ sf::Text text(sf::String::fromUtf8(str.begin(), str.end()), font, 40);
sf::FloatRect rect;
float scale;
v2f_t offset;