aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-07 06:34:22 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-07 06:34:24 +0200
commit9ebc3e3f5cf4847239d04cf5b3b01d0b1855a039 (patch)
tree7a421d42e8945a1718b9c54f474acbb2d2478c28 /include
parent7a2cb2c4b81a8a0696d3a11ce8781542f181bb12 (diff)
Continue text edit, add avatar (image, but not way to change avatar)
Diffstat (limited to 'include')
-rw-r--r--include/Channel.hpp2
-rw-r--r--include/Gif.hpp2
-rw-r--r--include/ResourceCache.hpp3
-rw-r--r--include/Text.hpp2
-rw-r--r--include/User.hpp1
5 files changed, 7 insertions, 3 deletions
diff --git a/include/Channel.hpp b/include/Channel.hpp
index 17128fd..1acfcd1 100644
--- a/include/Channel.hpp
+++ b/include/Channel.hpp
@@ -40,7 +40,7 @@ namespace dchat
OnlineUser* getUserByPublicKey(const odhtdb::Signature::PublicKey &publicKey);
const odhtdb::DatabaseNode& getNodeInfo() const;
- // If timestamp is 0, then timestamp is not used
+ // If timestamp is 0, then current time is used
void addLocalMessage(const std::string &msg, User *owner, u64 timestampSeconds = 0);
void addMessage(const std::string &msg);
void addUserLocally(User *user);
diff --git a/include/Gif.hpp b/include/Gif.hpp
index 84299e9..8f5d4e7 100644
--- a/include/Gif.hpp
+++ b/include/Gif.hpp
@@ -32,7 +32,7 @@ namespace dchat
void setPosition(const sf::Vector2f &position);
void setScale(const sf::Vector2f &scale);
- void draw(sf::RenderTarget &target);
+ void draw(sf::RenderTarget &target, const sf::RenderStates &renderStates = sf::RenderStates::Default);
static bool isDataGif(const StringView &data);
private:
diff --git a/include/ResourceCache.hpp b/include/ResourceCache.hpp
index de35500..75ebd88 100644
--- a/include/ResourceCache.hpp
+++ b/include/ResourceCache.hpp
@@ -2,6 +2,7 @@
#include <SFML/Graphics/Font.hpp>
#include <SFML/Graphics/Texture.hpp>
+#include <SFML/Graphics/Shader.hpp>
#include <string>
#include <stdexcept>
@@ -21,5 +22,7 @@ namespace dchat
// Throws FailedToLoadResourceException on failure
static sf::Texture* getTexture(const std::string &filepath);
+
+ static sf::Shader* getShader(const std::string &filepath, sf::Shader::Type shaderType);
};
}
diff --git a/include/Text.hpp b/include/Text.hpp
index 9df973d..0bc3ced 100644
--- a/include/Text.hpp
+++ b/include/Text.hpp
@@ -87,7 +87,7 @@ namespace dchat
bool plainText;
bool editable;
CaretMoveDirection caretMoveDirection;
- float totalHeight;
+ sf::FloatRect boundingBox;
float lineSpacing;
std::vector<TextElement> textElements;
diff --git a/include/User.hpp b/include/User.hpp
index 821be6f..a83b9dc 100644
--- a/include/User.hpp
+++ b/include/User.hpp
@@ -24,6 +24,7 @@ namespace dchat
virtual const std::string& getName() const = 0;
const Type type;
+ std::string avatarUrl;
};
class OnlineUser : public User