diff options
Diffstat (limited to 'editor/editor_export.h')
-rw-r--r-- | editor/editor_export.h | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/editor/editor_export.h b/editor/editor_export.h index 3b99c68c85..b6ea4fd889 100644 --- a/editor/editor_export.h +++ b/editor/editor_export.h @@ -124,6 +124,7 @@ class EditorExportPlatform : public Reference { public: typedef Error (*EditorExportSaveFunction)(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total); + typedef Error (*EditorExportSaveSharedObject)(void *p_userdata, const String &p_path); private: struct SavedData { @@ -189,7 +190,7 @@ public: virtual String get_name() const = 0; virtual Ref<Texture> get_logo() const = 0; - Error export_project_files(const Ref<EditorExportPreset> &p_preset, EditorExportSaveFunction p_func, void *p_udata); + Error export_project_files(const Ref<EditorExportPreset> &p_preset, EditorExportSaveFunction p_func, void *p_udata, EditorExportSaveSharedObject p_so_func = NULL); Error save_pack(const Ref<EditorExportPreset> &p_preset, const String &p_path); Error save_zip(const Ref<EditorExportPreset> &p_preset, const String &p_path); @@ -219,11 +220,49 @@ public: EditorExportPlatform(); }; +class EditorExportPlugin : public Reference { + GDCLASS(EditorExportPlugin, Reference) + + friend class EditorExportPlatform; + + Vector<String> shared_objects; + struct ExtraFile { + String path; + Vector<uint8_t> data; + bool remap; + }; + Vector<ExtraFile> extra_files; + bool skipped; + + _FORCE_INLINE_ void _clear() { + shared_objects.clear(); + extra_files.clear(); + skipped = false; + } + + void _export_file_script(const String &p_path, const String &p_type, const PoolVector<String> &p_features); + void _export_begin_script(const PoolVector<String> &p_features); + +protected: + void add_file(const String &p_path, const Vector<uint8_t> &p_file, bool p_remap); + void add_shared_object(const String &p_path); + void skip(); + + virtual void _export_file(const String &p_path, const String &p_type, const Set<String> &p_features); + virtual void _export_begin(const Set<String> &p_features); + + static void _bind_methods(); + +public: + EditorExportPlugin(); +}; + class EditorExport : public Node { GDCLASS(EditorExport, Node); Vector<Ref<EditorExportPlatform> > export_platforms; Vector<Ref<EditorExportPreset> > export_presets; + Vector<Ref<EditorExportPlugin> > export_plugins; Timer *save_timer; bool block_save; @@ -251,6 +290,10 @@ public: Ref<EditorExportPreset> get_export_preset(int p_idx); void remove_export_preset(int p_idx); + void add_export_plugin(const Ref<EditorExportPlugin> &p_plugin); + void remove_export_plugin(const Ref<EditorExportPlugin> &p_plugin); + Vector<Ref<EditorExportPlugin> > get_export_plugins(); + void load_config(); bool poll_export_platforms(); |