summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorK. S. Ernest (iFire) Lee <fire@users.noreply.github.com>2021-08-02 18:41:05 -0700
committerGitHub <noreply@github.com>2021-08-02 18:41:05 -0700
commit04703c6f66be07e4ee305407713ad14a18e19ce3 (patch)
tree4e2c24d34c9ce8265ffeab7976e3c0ab9923fada /scene
parentc17a541650184ce05ff9153a71a6f37a4d8ea63e (diff)
parent6640ab406b4a3d59a1a4c3059d243f438d4f453b (diff)
Merge pull request #51042 from nikitalita/fix_binary_res_load_save
Fix binary resource loading and saving
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/resource_format_text.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp
index 250a2311a0..2b93414906 100644
--- a/scene/resources/resource_format_text.cpp
+++ b/scene/resources/resource_format_text.cpp
@@ -1019,11 +1019,11 @@ Error ResourceLoaderText::save_as_binary(FileAccess *p_f, const String &p_path)
bs_save_unicode_string(wf.f, is_scene ? "PackedScene" : resource_type);
wf->store_64(0); //offset to import metadata, this is no longer used
- f->store_32(ResourceFormatSaverBinaryInstance::FORMAT_FLAG_NAMED_SCENE_IDS | ResourceFormatSaverBinaryInstance::FORMAT_FLAG_UIDS);
+ wf->store_32(ResourceFormatSaverBinaryInstance::FORMAT_FLAG_NAMED_SCENE_IDS | ResourceFormatSaverBinaryInstance::FORMAT_FLAG_UIDS);
- f->store_64(res_uid);
+ wf->store_64(res_uid);
- for (int i = 0; i < 5; i++) {
+ for (int i = 0; i < ResourceFormatSaverBinaryInstance::RESERVED_FIELDS; i++) {
wf->store_32(0); // reserved
}
@@ -1073,7 +1073,7 @@ Error ResourceLoaderText::save_as_binary(FileAccess *p_f, const String &p_path)
bs_save_unicode_string(wf.f, type);
bs_save_unicode_string(wf.f, path);
- wf.f->store_64(uid);
+ wf->store_64(uid);
int lindex = dummy_read.external_resources.size();
Ref<DummyResource> dr;