diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-04-29 08:17:30 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-04-29 08:17:36 +0200 |
commit | f90a5705bd65a4ebb5edc9df003a383039fec555 (patch) | |
tree | f0180d946bddc15a0a13d9148562418cb3a4108e /include | |
parent | 68dcd3c4e17355e1c2b640fe1382743d7cb61ea2 (diff) |
Change design, fix crash when closing application
Diffstat (limited to 'include')
-rw-r--r-- | include/Cache.hpp | 2 | ||||
-rw-r--r-- | include/Channel.hpp | 3 | ||||
-rw-r--r-- | include/ChannelTopPanel.hpp | 13 | ||||
-rw-r--r-- | include/Settings.hpp | 1 | ||||
-rw-r--r-- | include/UsersSidePanel.hpp | 3 | ||||
-rw-r--r-- | include/Video.hpp | 1 |
6 files changed, 20 insertions, 3 deletions
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<ImageDownloadInfo> imageDownloadProcesses; std::vector<ImageDownloadInfo> 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 <SFML/Graphics/RenderWindow.hpp> + +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; }; } |