summaryrefslogtreecommitdiff
path: root/platform/web/export
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-13 18:00:18 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-13 18:00:18 +0100
commit3dffe0b967e1fe1b5407bc02e3308748865ee21d (patch)
treecd923cc48249a7a53d3cad987ea25ec6af7cdaf7 /platform/web/export
parent3c9bf4bc210a8e6a208f30ca59de4d4d7e18c04d (diff)
parentcebefc9f5d26bc5207e6ba399e67a82f76216f13 (diff)
Merge pull request #63312 from bruvzg/one_click
[Export] Add one-click deploy over SSH for the desktop exports.
Diffstat (limited to 'platform/web/export')
-rw-r--r--platform/web/export/export_plugin.cpp21
-rw-r--r--platform/web/export/export_plugin.h5
2 files changed, 20 insertions, 6 deletions
diff --git a/platform/web/export/export_plugin.cpp b/platform/web/export/export_plugin.cpp
index 3e11db6887..9c31ca1268 100644
--- a/platform/web/export/export_plugin.cpp
+++ b/platform/web/export/export_plugin.cpp
@@ -31,7 +31,15 @@
#include "export_plugin.h"
#include "core/config/project_settings.h"
+#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
+#include "platform/web/logo_svg.gen.h"
+#include "platform/web/run_icon_svg.gen.h"
+
+#include "modules/modules_enabled.gen.h" // For svg.
+#ifdef MODULE_SVG_ENABLED
+#include "modules/svg/image_loader_svg.h"
+#endif
Error EditorExportPlatformWeb::_extract_template(const String &p_template, const String &p_dir, const String &p_name, bool pwa) {
Ref<FileAccess> io_fa;
@@ -651,8 +659,17 @@ EditorExportPlatformWeb::EditorExportPlatformWeb() {
server.instantiate();
server_thread.start(_server_thread_poll, this);
- logo = ImageTexture::create_from_image(memnew(Image(_web_logo)));
- run_icon = ImageTexture::create_from_image(memnew(Image(_web_run_icon)));
+#ifdef MODULE_SVG_ENABLED
+ Ref<Image> img = memnew(Image);
+ const bool upsample = !Math::is_equal_approx(Math::round(EDSCALE), EDSCALE);
+
+ ImageLoaderSVG img_loader;
+ img_loader.create_image_from_string(img, _web_logo_svg, EDSCALE, upsample, false);
+ logo = ImageTexture::create_from_image(img);
+
+ img_loader.create_image_from_string(img, _web_run_icon_svg, EDSCALE, upsample, false);
+ run_icon = ImageTexture::create_from_image(img);
+#endif
Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme();
if (theme.is_valid()) {
diff --git a/platform/web/export/export_plugin.h b/platform/web/export/export_plugin.h
index b85492b66f..e74c945837 100644
--- a/platform/web/export/export_plugin.h
+++ b/platform/web/export/export_plugin.h
@@ -38,11 +38,8 @@
#include "core/io/zip_io.h"
#include "editor/editor_node.h"
#include "editor/export/editor_export_platform.h"
-#include "main/splash.gen.h"
-#include "platform/web/logo.gen.h"
-#include "platform/web/run_icon.gen.h"
-
#include "editor_http_server.h"
+#include "main/splash.gen.h"
class EditorExportPlatformWeb : public EditorExportPlatform {
GDCLASS(EditorExportPlatformWeb, EditorExportPlatform);