diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mono/mono_gd/gd_mono.cpp | 3 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_marshal.cpp | 18 |
2 files changed, 11 insertions, 10 deletions
diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index 2c88832998..98b57adc50 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -285,7 +285,8 @@ bool GDMono::_load_assembly(const String &p_name, GDMonoAssembly **r_assembly) { MonoAssembly *assembly = mono_assembly_load_full(aname, NULL, &status, false); mono_assembly_name_free(aname); - ERR_FAIL_NULL_V(assembly, false); + if (!assembly) + return false; uint32_t domain_id = mono_domain_get_id(mono_domain_get()); diff --git a/modules/mono/mono_gd/gd_mono_marshal.cpp b/modules/mono/mono_gd/gd_mono_marshal.cpp index b64915109f..9a6c8f0cd6 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.cpp +++ b/modules/mono/mono_gd/gd_mono_marshal.cpp @@ -705,9 +705,9 @@ MonoArray *PoolColorArray_to_mono_array(const PoolColorArray &p_array) { real_t *raw = (real_t *)mono_array_addr_with_size(ret, sizeof(real_t) * 4, i); const Color &elem = p_array[i]; raw[0] = elem.r; - raw[4] = elem.g; - raw[8] = elem.b; - raw[12] = elem.a; + raw[1] = elem.g; + raw[2] = elem.b; + raw[3] = elem.a; #endif } @@ -719,7 +719,7 @@ PoolColorArray mono_array_to_PoolColorArray(MonoArray *p_array) { int length = mono_array_length(p_array); for (int i = 0; i < length; i++) { - real_t *raw_elem = mono_array_get(p_array, real_t *, i); + real_t *raw_elem = (real_t *)mono_array_addr_with_size(p_array, sizeof(real_t) * 4, i); MARSHALLED_IN(Color, raw_elem, elem); ret.push_back(elem); } @@ -737,7 +737,7 @@ MonoArray *PoolVector2Array_to_mono_array(const PoolVector2Array &p_array) { real_t *raw = (real_t *)mono_array_addr_with_size(ret, sizeof(real_t) * 2, i); const Vector2 &elem = p_array[i]; raw[0] = elem.x; - raw[4] = elem.y; + raw[1] = elem.y; #endif } @@ -749,7 +749,7 @@ PoolVector2Array mono_array_to_PoolVector2Array(MonoArray *p_array) { int length = mono_array_length(p_array); for (int i = 0; i < length; i++) { - real_t *raw_elem = mono_array_get(p_array, real_t *, i); + real_t *raw_elem = (real_t *)mono_array_addr_with_size(p_array, sizeof(real_t) * 2, i); MARSHALLED_IN(Vector2, raw_elem, elem); ret.push_back(elem); } @@ -767,8 +767,8 @@ MonoArray *PoolVector3Array_to_mono_array(const PoolVector3Array &p_array) { real_t *raw = (real_t *)mono_array_addr_with_size(ret, sizeof(real_t) * 3, i); const Vector3 &elem = p_array[i]; raw[0] = elem.x; - raw[4] = elem.y; - raw[8] = elem.z; + raw[1] = elem.y; + raw[2] = elem.z; #endif } @@ -780,7 +780,7 @@ PoolVector3Array mono_array_to_PoolVector3Array(MonoArray *p_array) { int length = mono_array_length(p_array); for (int i = 0; i < length; i++) { - real_t *raw_elem = mono_array_get(p_array, real_t *, i); + real_t *raw_elem = (real_t *)mono_array_addr_with_size(p_array, sizeof(real_t) * 3, i); MARSHALLED_IN(Vector3, raw_elem, elem); ret.push_back(elem); } |