From c3606cb5f3ab82248cac0d748bb291aa978b0b58 Mon Sep 17 00:00:00 2001 From: kobewi Date: Fri, 3 Jun 2022 01:33:42 +0200 Subject: Swap arguments of ResourceSaver.save() --- modules/gdscript/gdscript.cpp | 2 +- modules/gdscript/gdscript.h | 2 +- modules/minimp3/resource_importer_mp3.cpp | 2 +- modules/mono/csharp_script.cpp | 2 +- modules/mono/csharp_script.h | 2 +- modules/openxr/editor/openxr_action_map_editor.cpp | 2 +- modules/openxr/openxr_interface.cpp | 2 +- modules/vorbis/resource_importer_ogg_vorbis.cpp | 2 +- modules/webp/resource_saver_webp.cpp | 2 +- modules/webp/resource_saver_webp.h | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) (limited to 'modules') diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 28722bd178..d752bef14f 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -2380,7 +2380,7 @@ void ResourceFormatLoaderGDScript::get_dependencies(const String &p_path, List &p_resource, uint32_t p_flags) { +Error ResourceFormatSaverGDScript::save(const Ref &p_resource, const String &p_path, uint32_t p_flags) { Ref sqscr = p_resource; ERR_FAIL_COND_V(sqscr.is_null(), ERR_INVALID_PARAMETER); diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 47de3ad088..5123cccddd 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -524,7 +524,7 @@ public: class ResourceFormatSaverGDScript : public ResourceFormatSaver { public: - virtual Error save(const String &p_path, const Ref &p_resource, uint32_t p_flags = 0); + virtual Error save(const Ref &p_resource, const String &p_path, uint32_t p_flags = 0); virtual void get_recognized_extensions(const Ref &p_resource, List *p_extensions) const; virtual bool recognize(const Ref &p_resource) const; }; diff --git a/modules/minimp3/resource_importer_mp3.cpp b/modules/minimp3/resource_importer_mp3.cpp index 8526aeef38..7492533094 100644 --- a/modules/minimp3/resource_importer_mp3.cpp +++ b/modules/minimp3/resource_importer_mp3.cpp @@ -128,7 +128,7 @@ Error ResourceImporterMP3::import(const String &p_source_file, const String &p_s mp3_stream->set_beat_count(beat_count); mp3_stream->set_bar_beats(bar_beats); - return ResourceSaver::save(p_save_path + ".mp3str", mp3_stream); + return ResourceSaver::save(mp3_stream, p_save_path + ".mp3str"); } ResourceImporterMP3::ResourceImporterMP3() { diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 06793d25e0..c7279be97f 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -3630,7 +3630,7 @@ String ResourceFormatLoaderCSharpScript::get_resource_type(const String &p_path) return p_path.get_extension().to_lower() == "cs" ? CSharpLanguage::get_singleton()->get_type() : ""; } -Error ResourceFormatSaverCSharpScript::save(const String &p_path, const Ref &p_resource, uint32_t p_flags) { +Error ResourceFormatSaverCSharpScript::save(const Ref &p_resource, const String &p_path, uint32_t p_flags) { Ref sqscr = p_resource; ERR_FAIL_COND_V(sqscr.is_null(), ERR_INVALID_PARAMETER); diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index bd46a06a92..48129e69cb 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -543,7 +543,7 @@ public: class ResourceFormatSaverCSharpScript : public ResourceFormatSaver { public: - Error save(const String &p_path, const Ref &p_resource, uint32_t p_flags = 0) override; + Error save(const Ref &p_resource, const String &p_path, uint32_t p_flags = 0) override; void get_recognized_extensions(const Ref &p_resource, List *p_extensions) const override; bool recognize(const Ref &p_resource) const override; }; diff --git a/modules/openxr/editor/openxr_action_map_editor.cpp b/modules/openxr/editor/openxr_action_map_editor.cpp index 87b7f50224..0a2d0a3110 100644 --- a/modules/openxr/editor/openxr_action_map_editor.cpp +++ b/modules/openxr/editor/openxr_action_map_editor.cpp @@ -258,7 +258,7 @@ void OpenXRActionMapEditor::_load_action_map(const String p_path, bool p_create_ } void OpenXRActionMapEditor::_on_save_action_map() { - Error err = ResourceSaver::save(edited_path, action_map); + Error err = ResourceSaver::save(action_map, edited_path); if (err != OK) { EditorNode::get_singleton()->show_warning(vformat(TTR("Error saving file: %s"), edited_path)); return; diff --git a/modules/openxr/openxr_interface.cpp b/modules/openxr/openxr_interface.cpp index 1447be5c77..6c2f08e21d 100644 --- a/modules/openxr/openxr_interface.cpp +++ b/modules/openxr/openxr_interface.cpp @@ -123,7 +123,7 @@ void OpenXRInterface::_load_action_map() { #ifdef TOOLS_ENABLED // Save our action sets so our user can action_map->set_path(default_tres_name, true); - ResourceSaver::save(default_tres_name, action_map); + ResourceSaver::save(action_map, default_tres_name); #endif } } diff --git a/modules/vorbis/resource_importer_ogg_vorbis.cpp b/modules/vorbis/resource_importer_ogg_vorbis.cpp index 1ad1366d0b..bf5f7206b8 100644 --- a/modules/vorbis/resource_importer_ogg_vorbis.cpp +++ b/modules/vorbis/resource_importer_ogg_vorbis.cpp @@ -226,7 +226,7 @@ Error ResourceImporterOggVorbis::import(const String &p_source_file, const Strin ogg_vorbis_stream->set_beat_count(beat_count); ogg_vorbis_stream->set_bar_beats(bar_beats); - return ResourceSaver::save(p_save_path + ".oggvorbisstr", ogg_vorbis_stream); + return ResourceSaver::save(ogg_vorbis_stream, p_save_path + ".oggvorbisstr"); } ResourceImporterOggVorbis::ResourceImporterOggVorbis() { diff --git a/modules/webp/resource_saver_webp.cpp b/modules/webp/resource_saver_webp.cpp index d270d39163..bd71c2869a 100644 --- a/modules/webp/resource_saver_webp.cpp +++ b/modules/webp/resource_saver_webp.cpp @@ -35,7 +35,7 @@ #include "scene/resources/texture.h" #include "webp_common.h" -Error ResourceSaverWebP::save(const String &p_path, const Ref &p_resource, uint32_t p_flags) { +Error ResourceSaverWebP::save(const Ref &p_resource, const String &p_path, uint32_t p_flags) { Ref texture = p_resource; ERR_FAIL_COND_V_MSG(!texture.is_valid(), ERR_INVALID_PARAMETER, "Can't save invalid texture as WEBP."); diff --git a/modules/webp/resource_saver_webp.h b/modules/webp/resource_saver_webp.h index 59e944efa0..cbd5864463 100644 --- a/modules/webp/resource_saver_webp.h +++ b/modules/webp/resource_saver_webp.h @@ -39,7 +39,7 @@ public: static Error save_image(const String &p_path, const Ref &p_img, const bool p_lossy = false, const float p_quality = 0.75f); static Vector save_image_to_buffer(const Ref &p_img, const bool p_lossy = false, const float p_quality = 0.75f); - virtual Error save(const String &p_path, const Ref &p_resource, uint32_t p_flags = 0); + virtual Error save(const Ref &p_resource, const String &p_path, uint32_t p_flags = 0); virtual bool recognize(const Ref &p_resource) const; virtual void get_recognized_extensions(const Ref &p_resource, List *p_extensions) const; -- cgit v1.2.3