diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-03-05 16:44:50 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2017-03-05 16:44:50 +0100 |
commit | 5dbf1809c6e3e905b94b8764e99491e608122261 (patch) | |
tree | 5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /editor/editor_resource_preview.h | |
parent | 45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff) |
A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?
I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon
A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format
A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
Diffstat (limited to 'editor/editor_resource_preview.h')
-rw-r--r-- | editor/editor_resource_preview.h | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h index e4a593330d..ad7f0946e5 100644 --- a/editor/editor_resource_preview.h +++ b/editor/editor_resource_preview.h @@ -29,9 +29,9 @@ #ifndef EDITORRESOURCEPREVIEW_H #define EDITORRESOURCEPREVIEW_H -#include "scene/main/node.h" #include "os/semaphore.h" #include "os/thread.h" +#include "scene/main/node.h" #include "scene/resources/texture.h" /* make previews for: @@ -52,30 +52,26 @@ -curve and curve2D */ - class EditorResourcePreviewGenerator : public Reference { - GDCLASS(EditorResourcePreviewGenerator,Reference ); + GDCLASS(EditorResourcePreviewGenerator, Reference); protected: - static void _bind_methods(); -public: - virtual bool handles(const String& p_type) const; - virtual Ref<Texture> generate(const RES& p_from); - virtual Ref<Texture> generate_from_path(const String& p_path); +public: + virtual bool handles(const String &p_type) const; + virtual Ref<Texture> generate(const RES &p_from); + virtual Ref<Texture> generate_from_path(const String &p_path); EditorResourcePreviewGenerator(); }; - class EditorResourcePreview : public Node { - GDCLASS(EditorResourcePreview,Node); - + GDCLASS(EditorResourcePreview, Node); - static EditorResourcePreview* singleton; + static EditorResourcePreview *singleton; struct QueueItem { Ref<Resource> resource; @@ -101,31 +97,29 @@ class EditorResourcePreview : public Node { int order; - Map<String,Item> cache; + Map<String, Item> cache; - void _preview_ready(const String& p_str,const Ref<Texture>& p_texture, ObjectID id, const StringName &p_func, const Variant &p_ud); - Ref<Texture> _generate_preview(const QueueItem& p_item, const String &cache_base); + void _preview_ready(const String &p_str, const Ref<Texture> &p_texture, ObjectID id, const StringName &p_func, const Variant &p_ud); + Ref<Texture> _generate_preview(const QueueItem &p_item, const String &cache_base); static void _thread_func(void *ud); void _thread(); Vector<Ref<EditorResourcePreviewGenerator> > preview_generators; - protected: - static void _bind_methods(); -public: - static EditorResourcePreview* get_singleton(); +public: + static EditorResourcePreview *get_singleton(); //callback funtion is callback(String p_path,Ref<Texture> preview,Variant udata) preview null if could not load - void queue_resource_preview(const String& p_res, Object* p_receiver, const StringName& p_receiver_func, const Variant& p_userdata); - void queue_edited_resource_preview(const Ref<Resource>& p_path, Object* p_receiver, const StringName& p_receiver_func, const Variant& p_userdata); + void queue_resource_preview(const String &p_res, Object *p_receiver, const StringName &p_receiver_func, const Variant &p_userdata); + void queue_edited_resource_preview(const Ref<Resource> &p_path, Object *p_receiver, const StringName &p_receiver_func, const Variant &p_userdata); - void add_preview_generator(const Ref<EditorResourcePreviewGenerator>& p_generator); - void remove_preview_generator(const Ref<EditorResourcePreviewGenerator>& p_generator); - void check_for_invalidation(const String& p_path); + void add_preview_generator(const Ref<EditorResourcePreviewGenerator> &p_generator); + void remove_preview_generator(const Ref<EditorResourcePreviewGenerator> &p_generator); + void check_for_invalidation(const String &p_path); EditorResourcePreview(); ~EditorResourcePreview(); |