summaryrefslogtreecommitdiff
path: root/platform/linuxbsd/export
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2022-03-20 22:30:31 -0500
committerAaron Franke <arnfranke@yahoo.com>2022-03-21 12:50:31 -0500
commitf301451fa3304ad2072898838ea9801b044ffbd9 (patch)
treea83a1f8334af52f9f88538fa52d8e01028c77f25 /platform/linuxbsd/export
parent5a28b1ae5118d05b5d22fe2f6f1109f839058c9d (diff)
Move extension logic to EditorExportPlatformLinuxBSD
Diffstat (limited to 'platform/linuxbsd/export')
-rw-r--r--platform/linuxbsd/export/export_plugin.cpp21
-rw-r--r--platform/linuxbsd/export/export_plugin.h3
2 files changed, 24 insertions, 0 deletions
diff --git a/platform/linuxbsd/export/export_plugin.cpp b/platform/linuxbsd/export/export_plugin.cpp
index 6300a37854..08fc9c0452 100644
--- a/platform/linuxbsd/export/export_plugin.cpp
+++ b/platform/linuxbsd/export/export_plugin.cpp
@@ -73,6 +73,27 @@ Error EditorExportPlatformLinuxBSD::export_project(const Ref<EditorExportPreset>
return err;
}
+void EditorExportPlatformLinuxBSD::set_extension(const String &p_extension, const String &p_feature_key) {
+ extensions[p_feature_key] = p_extension;
+}
+
+List<String> EditorExportPlatformLinuxBSD::get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const {
+ List<String> list;
+ for (const KeyValue<String, String> &E : extensions) {
+ if (p_preset->get(E.key)) {
+ list.push_back(extensions[E.key]);
+ return list;
+ }
+ }
+
+ if (extensions.has("default")) {
+ list.push_back(extensions["default"]);
+ return list;
+ }
+
+ return list;
+}
+
Error EditorExportPlatformLinuxBSD::fixup_embedded_pck(const String &p_path, int64_t p_embedded_start, int64_t p_embedded_size) const {
// Patch the header of the "pck" section in the ELF file so that it corresponds to the embedded data
diff --git a/platform/linuxbsd/export/export_plugin.h b/platform/linuxbsd/export/export_plugin.h
index ba6c9a6a6b..593916e586 100644
--- a/platform/linuxbsd/export/export_plugin.h
+++ b/platform/linuxbsd/export/export_plugin.h
@@ -38,9 +38,12 @@
#include "scene/resources/texture.h"
class EditorExportPlatformLinuxBSD : public EditorExportPlatformPC {
+ Map<String, String> extensions;
Error _export_debug_script(const Ref<EditorExportPreset> &p_preset, const String &p_app_name, const String &p_pkg_name, const String &p_path);
public:
+ void set_extension(const String &p_extension, const String &p_feature_key = "default");
+ virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const override;
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) override;
virtual Error fixup_embedded_pck(const String &p_path, int64_t p_embedded_start, int64_t p_embedded_size) const override;
};