From 0fb56002dd2f02ad9d10b1017a221936a194992c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 20 May 2018 23:16:47 +0200 Subject: Update sfml version --- project.conf | 6 +++--- src/Text.cpp | 1 + src/main.cpp | 13 +++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/project.conf b/project.conf index cf60d63..09891f7 100644 --- a/project.conf +++ b/project.conf @@ -5,9 +5,9 @@ type = "executable" platforms = ["linux32", "linux64"] [dependencies] -sfml-window = "2.4.2" -sfml-graphics = "2.4.2" -sfml-system = "2.4.2" +sfml-window = "2.5" +sfml-graphics = "2.5" +sfml-system = "2.5" boost-filesystem = "1.66.0" tiny-process = "2.0.0" mpv = "1.25.0" diff --git a/src/Text.cpp b/src/Text.cpp index 3aa1574..2292a4e 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -22,6 +22,7 @@ namespace dchat Text::Text(const sf::Font *_font) : font(_font), characterSize(0), + vertices(sf::PrimitiveType::Quads), maxWidth(0.0f), color(sf::Color::White), urlColor(URL_COLOR), diff --git a/src/main.cpp b/src/main.cpp index a66945c..4440315 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -659,11 +659,11 @@ int main(int argc, char **argv) Channel::getCurrent()->addLocalMessage(msg, Channel::getCurrent()->getSystemUser()); }); - sf::Event event; while (window.isOpen()) { Channel *currentChannel = Channel::getCurrent(); + sf::Event event; while (window.pollEvent(event)) { if (event.type == sf::Event::Closed) @@ -695,11 +695,12 @@ int main(int argc, char **argv) if(focused) { ImagePreview::processEvent(event); - if(!ImagePreview::getPreviewContentPtr() && ImagePreview::getTimeSinceLastSeenMs() > 250) - { - GlobalContextMenu::processEvent(event); - currentChannel->processEvent(event, cache); - } + } + + if(!ImagePreview::getPreviewContentPtr() && ImagePreview::getTimeSinceLastSeenMs() > 250) + { + GlobalContextMenu::processEvent(event); + currentChannel->processEvent(event, cache); } } -- cgit v1.2.3