From f90a5705bd65a4ebb5edc9df003a383039fec555 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 29 Apr 2018 08:17:30 +0200 Subject: Change design, fix crash when closing application --- include/Cache.hpp | 2 ++ include/Channel.hpp | 3 +++ include/ChannelTopPanel.hpp | 13 +++++++++++++ include/Settings.hpp | 1 + include/UsersSidePanel.hpp | 3 --- include/Video.hpp | 1 + 6 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 include/ChannelTopPanel.hpp (limited to 'include') diff --git a/include/Cache.hpp b/include/Cache.hpp index d78324c..429f652 100644 --- a/include/Cache.hpp +++ b/include/Cache.hpp @@ -44,6 +44,7 @@ namespace dchat { public: Cache(); + ~Cache(); // Creates directory if it doesn't exist (recursively). Throws boost exception on failure static boost::filesystem::path getDchatDir(); @@ -63,5 +64,6 @@ namespace dchat std::vector imageDownloadProcesses; std::vector imageDownloadProcessesQueue; std::mutex imageDownloadMutex; + bool alive; }; } diff --git a/include/Channel.hpp b/include/Channel.hpp index 6f5495f..31a17f4 100644 --- a/include/Channel.hpp +++ b/include/Channel.hpp @@ -34,6 +34,9 @@ namespace dchat void processEvent(const sf::Event &event); void draw(sf::RenderWindow &window, Cache &cache); + + static void setCurrent(Channel *channel); + static Channel* getCurrent(); protected: odhtdb::Database *database; odhtdb::DatabaseNode databaseNodeInfo; diff --git a/include/ChannelTopPanel.hpp b/include/ChannelTopPanel.hpp new file mode 100644 index 0000000..41fe9a2 --- /dev/null +++ b/include/ChannelTopPanel.hpp @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace dchat +{ + class ChannelTopPanel + { + public: + static void draw(sf::RenderWindow &window); + static float getHeight(); + }; +} diff --git a/include/Settings.hpp b/include/Settings.hpp index ab757ec..1228873 100644 --- a/include/Settings.hpp +++ b/include/Settings.hpp @@ -6,5 +6,6 @@ namespace dchat { public: static float getScaling(); + static void setScaling(float scaling); }; } diff --git a/include/UsersSidePanel.hpp b/include/UsersSidePanel.hpp index b2855bb..07e790c 100644 --- a/include/UsersSidePanel.hpp +++ b/include/UsersSidePanel.hpp @@ -9,9 +9,6 @@ namespace dchat class UsersSidePanel { public: - static void setCurrentChannel(Channel *channel); - static Channel* getCurrentChannel(); - static void draw(sf::RenderWindow &window); static float getWidth(); }; diff --git a/include/Video.hpp b/include/Video.hpp index 05c8396..9d6663e 100644 --- a/include/Video.hpp +++ b/include/Video.hpp @@ -41,5 +41,6 @@ namespace dchat sf::Sprite sprite; sf::Texture texture; sf::Uint8 *textureBuffer; + bool alive; }; } -- cgit v1.2.3