diff options
Diffstat (limited to 'include/Cache.hpp')
-rw-r--r-- | include/Cache.hpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/Cache.hpp b/include/Cache.hpp index 59d997a..0314e7e 100644 --- a/include/Cache.hpp +++ b/include/Cache.hpp @@ -14,6 +14,8 @@ namespace TinyProcessLib namespace dchat { + class Gif; + struct ImageByUrlResult { enum class Type @@ -23,9 +25,19 @@ namespace dchat FAILED_DOWNLOAD }; + ImageByUrlResult() : texture(nullptr), type(Type::DOWNLOADING), isGif(false) {} + ImageByUrlResult(sf::Texture *_texture, Type _type) : texture(_texture), type(_type), isGif(false) {} + ImageByUrlResult(Gif *_gif, Type _type) : gif(_gif), type(_type), isGif(true) {} + // @texture is null if @type is DOWNLOADING or FAILED_DOWNLOAD - sf::Texture *texture; + union + { + sf::Texture *texture; + Gif *gif; + }; + Type type; + bool isGif; }; class Cache |