summaryrefslogtreecommitdiff
path: root/modules/mono/glue/gd_glue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mono/glue/gd_glue.cpp')
-rw-r--r--modules/mono/glue/gd_glue.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/mono/glue/gd_glue.cpp b/modules/mono/glue/gd_glue.cpp
index 17483c4457..ce81ea391d 100644
--- a/modules/mono/glue/gd_glue.cpp
+++ b/modules/mono/glue/gd_glue.cpp
@@ -44,8 +44,8 @@
MonoObject *godot_icall_GD_bytes2var(MonoArray *p_bytes, MonoBoolean p_allow_objects) {
Variant ret;
- PoolByteArray varr = GDMonoMarshal::mono_array_to_PoolByteArray(p_bytes);
- PoolByteArray::Read r = varr.read();
+ PackedByteArray varr = GDMonoMarshal::mono_array_to_PackedByteArray(p_bytes);
+ const uint8_t *r = varr.ptr();
Error err = decode_variant(ret, r.ptr(), varr.size(), NULL, p_allow_objects);
if (err != OK) {
ret = RTR("Not enough bytes for decoding bytes, or invalid format.");
@@ -257,18 +257,18 @@ void godot_icall_GD_pushwarning(MonoString *p_str) {
MonoArray *godot_icall_GD_var2bytes(MonoObject *p_var, MonoBoolean p_full_objects) {
Variant var = GDMonoMarshal::mono_object_to_variant(p_var);
- PoolByteArray barr;
+ PackedByteArray barr;
int len;
Error err = encode_variant(var, NULL, len, p_full_objects);
ERR_FAIL_COND_V_MSG(err != OK, NULL, "Unexpected error encoding variable to bytes, likely unserializable type found (Object or RID).");
barr.resize(len);
{
- PoolByteArray::Write w = barr.write();
+ uint8_t *w = barr.ptrw();
encode_variant(var, w.ptr(), len, p_full_objects);
}
- return GDMonoMarshal::PoolByteArray_to_mono_array(barr);
+ return GDMonoMarshal::PackedByteArray_to_mono_array(barr);
}
MonoString *godot_icall_GD_var2str(MonoObject *p_var) {