aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-21 21:32:51 +0200
committerdec05eba <dec05eba@protonmail.com>2020-10-21 22:31:36 +0200
commit0d8293a5647c2bb10228658f0910515b38ff0d64 (patch)
treee97c10442c73e330672277940aaf0b38d2fc63eb /include
parent87fb6e5c0cce6e6aba8f646329af6f8070d27c63 (diff)
Workaround sfml image loading thread race condition
See: https://github.com/SFML/SFML/issues/1711 Also some other smaller changes
Diffstat (limited to 'include')
-rw-r--r--include/Body.hpp2
-rw-r--r--include/SfmlFixes.hpp11
2 files changed, 12 insertions, 1 deletions
diff --git a/include/Body.hpp b/include/Body.hpp
index 7bf89e2..baed595 100644
--- a/include/Body.hpp
+++ b/include/Body.hpp
@@ -209,7 +209,7 @@ namespace QuickMedia {
bool draw_thumbnails;
bool wrap_around;
// Set to {0, 0} to disable resizing
- sf::Vector2i thumbnail_resize_target_size;
+ sf::Vector2i thumbnail_max_size;
sf::Color line_separator_color;
BodyItemRenderCallback body_item_render_callback;
sf::Shader *thumbnail_mask_shader;
diff --git a/include/SfmlFixes.hpp b/include/SfmlFixes.hpp
new file mode 100644
index 0000000..fc893c5
--- /dev/null
+++ b/include/SfmlFixes.hpp
@@ -0,0 +1,11 @@
+#pragma once
+
+#include <SFML/Graphics/Image.hpp>
+
+namespace QuickMedia {
+ // See: https://github.com/SFML/SFML/issues/1711
+ // TODO: Remove when above is fixed, or fix ourselves and include the fixed sfml version as a dependency,
+ // or write our own image class (maybe even use stb like sfml does but no error reason printing)
+ bool load_image_from_file(sf::Image &image, const std::string &filepath);
+ bool load_image_from_memory(sf::Image &image, const void *data, size_t size);
+} \ No newline at end of file