diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-04-28 17:15:24 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-04-28 17:15:30 +0200 |
commit | 68dcd3c4e17355e1c2b640fe1382743d7cb61ea2 (patch) | |
tree | fdf108e1d9f8478e34c4336dbaf21715c3b6f61f /src/ChannelSidePanel.cpp | |
parent | 9d84d5d8e7f61a02c01eef021ea5e8b2f49dcf8f (diff) |
Use font pointer instead of copy to reduce memory usage, sfml ffs
Diffstat (limited to 'src/ChannelSidePanel.cpp')
-rw-r--r-- | src/ChannelSidePanel.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ChannelSidePanel.cpp b/src/ChannelSidePanel.cpp index eb5c74c..f5a4063 100644 --- a/src/ChannelSidePanel.cpp +++ b/src/ChannelSidePanel.cpp @@ -32,17 +32,17 @@ namespace dchat rect.setFillColor(sf::Color(30, 30, 30)); window.draw(rect); - const sf::Font &font = ResourceCache::getFont("fonts/Roboto-Regular.ttf"); + const sf::Font *font = ResourceCache::getFont("fonts/Roboto-Regular.ttf"); sf::Vector2f position(10.0f, 10.0f); for(Channel *channel : channels) { // TODO: Remove this shit sf::String str = "# "; str += sf::String::fromUtf8(channel->getName().begin(), channel->getName().end()); - sf::Text text(str, font, FONT_SIZE * Settings::getScaling()); + sf::Text text(str, *font, FONT_SIZE * Settings::getScaling()); text.setPosition(position); window.draw(text); - position.y += font.getLineSpacing(FONT_SIZE * Settings::getScaling()); + position.y += font->getLineSpacing(FONT_SIZE * Settings::getScaling()); } } |