summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-03-13 13:33:51 +0100
committerGitHub <noreply@github.com>2018-03-13 13:33:51 +0100
commit401a39f57e09a6e919e3291fd3e64e3ee320820f (patch)
tree0cdc3d2c74b832345d31590762b20f46e733bd95
parentbd82fc19e9aa394fd6b6fbc2f0bec9774976ae8b (diff)
parent899f7b125e843d7187ad7c614588d635ce989f80 (diff)
Merge pull request #17116 from poke1024/fix16734
Fix round preview getting square on "run scene" (issue 16734)
-rw-r--r--editor/editor_node.cpp1
-rw-r--r--editor/plugins/editor_preview_plugins.cpp2
-rw-r--r--editor/plugins/editor_preview_plugins.h2
3 files changed, 4 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 309a3b42ab..69451df060 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -984,6 +984,7 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) {
String file = cache_base + ".png";
+ post_process_preview(img);
img->save_png(file);
}
diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp
index 47d730cdf1..8542296bde 100644
--- a/editor/plugins/editor_preview_plugins.cpp
+++ b/editor/plugins/editor_preview_plugins.cpp
@@ -40,7 +40,7 @@
#include "scene/resources/material.h"
#include "scene/resources/mesh.h"
-static void post_process_preview(Ref<Image> p_image) {
+void post_process_preview(Ref<Image> p_image) {
if (p_image->get_format() != Image::FORMAT_RGBA8)
p_image->convert(Image::FORMAT_RGBA8);
diff --git a/editor/plugins/editor_preview_plugins.h b/editor/plugins/editor_preview_plugins.h
index 2e12515e30..35b5c3a5f0 100644
--- a/editor/plugins/editor_preview_plugins.h
+++ b/editor/plugins/editor_preview_plugins.h
@@ -33,6 +33,8 @@
#include "editor/editor_resource_preview.h"
+void post_process_preview(Ref<Image> p_image);
+
class EditorTexturePreviewPlugin : public EditorResourcePreviewGenerator {
GDCLASS(EditorTexturePreviewPlugin, EditorResourcePreviewGenerator)
public: