summaryrefslogtreecommitdiff
path: root/editor/editor_resource_preview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_resource_preview.cpp')
-rw-r--r--editor/editor_resource_preview.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp
index 706b77c142..083b382521 100644
--- a/editor/editor_resource_preview.cpp
+++ b/editor/editor_resource_preview.cpp
@@ -41,7 +41,7 @@
#include "editor/editor_settings.h"
bool EditorResourcePreviewGenerator::handles(const String &p_type) const {
- bool success;
+ bool success = false;
if (GDVIRTUAL_CALL(_handles, p_type, success)) {
return success;
}
@@ -70,21 +70,15 @@ Ref<Texture2D> EditorResourcePreviewGenerator::generate_from_path(const String &
}
bool EditorResourcePreviewGenerator::generate_small_preview_automatically() const {
- bool success;
- if (GDVIRTUAL_CALL(_generate_small_preview_automatically, success)) {
- return success;
- }
-
- return false;
+ bool success = false;
+ GDVIRTUAL_CALL(_generate_small_preview_automatically, success);
+ return success;
}
bool EditorResourcePreviewGenerator::can_generate_small_preview() const {
- bool success;
- if (GDVIRTUAL_CALL(_can_generate_small_preview, success)) {
- return success;
- }
-
- return false;
+ bool success = false;
+ GDVIRTUAL_CALL(_can_generate_small_preview, success);
+ return success;
}
void EditorResourcePreviewGenerator::_bind_methods() {
@@ -148,7 +142,7 @@ void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref<
return; //could not guess type
}
- int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
+ int thumbnail_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size");
thumbnail_size *= EDSCALE;
r_texture = Ref<ImageTexture>();
@@ -232,7 +226,7 @@ void EditorResourcePreview::_iterate() {
Ref<ImageTexture> texture;
Ref<ImageTexture> small_texture;
- int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
+ int thumbnail_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size");
thumbnail_size *= EDSCALE;
if (item.resource.is_valid()) {