From 68dcd3c4e17355e1c2b640fe1382743d7cb61ea2 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 28 Apr 2018 17:15:24 +0200 Subject: Use font pointer instead of copy to reduce memory usage, sfml ffs --- src/ChannelSidePanel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ChannelSidePanel.cpp') 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()); } } -- cgit v1.2.3