aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-21 18:20:00 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-21 18:20:00 +0100
commit44e66882f6e517b06522cb1e510ed9dea7574273 (patch)
treec25095570a1a9438d267b724236fefd22e68aeed /include
parent9d36cfb599490888fa54110c796e14b542c402df (diff)
Render emoji in text, do not show notification count for cache sync, lazy load 4chan board
Diffstat (limited to 'include')
-rw-r--r--include/Body.hpp3
-rw-r--r--include/ResourceLoader.hpp (renamed from include/FontLoader.hpp)12
-rw-r--r--include/Text.hpp2
3 files changed, 13 insertions, 4 deletions
diff --git a/include/Body.hpp b/include/Body.hpp
index 236a02d..43e2946 100644
--- a/include/Body.hpp
+++ b/include/Body.hpp
@@ -174,7 +174,7 @@ namespace QuickMedia {
BodyItem* get_selected() const;
std::shared_ptr<BodyItem> get_selected_shared();
- // Returns null if not visible item
+ // Returns null if no visible items. This is the item we can see the end of
BodyItem* get_last_fully_visible_item();
void clamp_selection();
@@ -205,6 +205,7 @@ namespace QuickMedia {
void set_page_scroll(float scroll) { page_scroll = scroll; }
float get_page_scroll() const { return page_scroll; }
+ // This is the item we can see the end of
bool is_last_item_fully_visible() const { return last_item_fully_visible; }
bool is_body_full_with_items() const { return items_cut_off; }
diff --git a/include/FontLoader.hpp b/include/ResourceLoader.hpp
index bff0f18..a332ba4 100644
--- a/include/FontLoader.hpp
+++ b/include/ResourceLoader.hpp
@@ -1,9 +1,12 @@
#pragma once
-#include <string>
-
namespace sf {
class Font;
+ class Texture;
+}
+
+namespace QuickMedia {
+ void set_resource_loader_root_path(const char *resource_root);
}
namespace QuickMedia::FontLoader {
@@ -16,4 +19,9 @@ namespace QuickMedia::FontLoader {
// Note: not thread-safe
sf::Font* get_font(FontType font_type);
+}
+
+namespace QuickMedia::TextureLoader {
+ // Note: not thread-safe
+ sf::Texture* get_texture(const char *filepath);
} \ No newline at end of file
diff --git a/include/Text.hpp b/include/Text.hpp
index f102c59..135a89c 100644
--- a/include/Text.hpp
+++ b/include/Text.hpp
@@ -139,7 +139,7 @@ namespace QuickMedia
sf::String str; // TODO: Remove this for non-editable text??? also replace with std::string? then we get more efficient editing of text
const bool bold_font;
unsigned int characterSize;
- sf::VertexArray vertices[2];
+ sf::VertexArray vertices[3];
float maxWidth;
sf::Vector2f position;
sf::Color color;