summaryrefslogtreecommitdiff
path: root/core/io/marshalls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/marshalls.cpp')
-rw-r--r--core/io/marshalls.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index 5c39b2fa1b..d0bc05566e 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -1068,6 +1068,21 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
flags |= ENCODE_FLAG_OBJECT_AS_ID;
}
} break;
+#ifdef REAL_T_IS_DOUBLE
+ case Variant::VECTOR2:
+ case Variant::VECTOR3:
+ case Variant::PACKED_VECTOR2_ARRAY:
+ case Variant::PACKED_VECTOR3_ARRAY:
+ case Variant::TRANSFORM2D:
+ case Variant::TRANSFORM3D:
+ case Variant::QUATERNION:
+ case Variant::PLANE:
+ case Variant::BASIS:
+ case Variant::RECT2:
+ case Variant::AABB: {
+ flags |= ENCODE_FLAG_64;
+ } break;
+#endif // REAL_T_IS_DOUBLE
default: {
} // nothing to do at this stage
}
@@ -1417,19 +1432,6 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
d.get_key_list(&keys);
for (const Variant &E : keys) {
- /*
- CharString utf8 = E->->utf8();
-
- if (buf) {
- encode_uint32(utf8.length()+1,buf);
- buf+=4;
- memcpy(buf,utf8.get_data(),utf8.length()+1);
- }
-
- r_len+=4+utf8.length()+1;
- while (r_len%4)
- r_len++; //pad
- */
int len;
Error err = encode_variant(E, buf, len, p_full_objects, p_depth + 1);
ERR_FAIL_COND_V(err, err);