summaryrefslogtreecommitdiffstats
path: root/scene
diff options
context:
space:
mode:
authornikitalita <69168929+nikitalita@users.noreply.github.com>2021-07-29 18:17:49 -0700
committernikitalita <69168929+nikitalita@users.noreply.github.com>2021-07-29 18:17:49 -0700
commit160601cc78d14d500095a5127d49c335b249141a (patch)
tree1eaf2f8af3e35a02a72d4d7e26a04a88d3734035 /scene
parent44012fa61db860e66182fd8ea0b7a11de9cd75a9 (diff)
downloadredot-engine-160601cc78d14d500095a5127d49c335b249141a.tar.gz
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 3f6e926aa7..f71f5f27cb 100644
--- a/scene/resources/resource_format_text.cpp
+++ b/scene/resources/resource_format_text.cpp
@@ -1020,11 +1020,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 < 11; i++) {
wf->store_32(0); // reserved
}
@@ -1074,7 +1074,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;