summaryrefslogtreecommitdiff
path: root/editor/editor_resource_preview.h
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_resource_preview.h')
-rw-r--r--editor/editor_resource_preview.h31
1 files changed, 9 insertions, 22 deletions
diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h
index 055ecc6bbf..ad4136e9ab 100644
--- a/editor/editor_resource_preview.h
+++ b/editor/editor_resource_preview.h
@@ -36,24 +36,6 @@
#include "scene/main/node.h"
#include "scene/resources/texture.h"
-/* make previews for:
-*packdscene
-*wav
-*image
-*mesh
--font
-*script
-*material
--shader
--shader graph?
--navigation mesh
--collision?
--occluder polygon
--navigation polygon
--tileset
--curve and curve2D
-*/
-
class EditorResourcePreviewGenerator : public Reference {
GDCLASS(EditorResourcePreviewGenerator, Reference);
@@ -63,10 +45,11 @@ protected:
public:
virtual bool handles(const String &p_type) const;
- virtual Ref<Texture> generate(const RES &p_from, const Size2 p_size) const;
- virtual Ref<Texture> generate_from_path(const String &p_path, const Size2 p_size) const;
+ virtual Ref<Texture> generate(const RES &p_from, const Size2 &p_size) const;
+ virtual Ref<Texture> generate_from_path(const String &p_path, const Size2 &p_size) const;
- virtual bool should_generate_small_preview() const;
+ virtual bool generate_small_preview_automatically() const;
+ virtual bool can_generate_small_preview() const;
EditorResourcePreviewGenerator();
};
@@ -90,7 +73,8 @@ class EditorResourcePreview : public Node {
Mutex *preview_mutex;
Semaphore *preview_sem;
Thread *thread;
- bool exit;
+ volatile bool exit;
+ volatile bool exited;
struct Item {
Ref<Texture> preview;
@@ -126,6 +110,9 @@ public:
void remove_preview_generator(const Ref<EditorResourcePreviewGenerator> &p_generator);
void check_for_invalidation(const String &p_path);
+ void start();
+ void stop();
+
EditorResourcePreview();
~EditorResourcePreview();
};