diff --git a/lime/utils/ArrayBufferView.hx b/lime/utils/ArrayBufferView.hx index 3d031116d..0bdf38dc1 100644 --- a/lime/utils/ArrayBufferView.hx +++ b/lime/utils/ArrayBufferView.hx @@ -396,6 +396,7 @@ abstract TypedArrayType(Int) from Int to Int { #if cpp untyped __global__.__hxcpp_memory_set_byte(buffer.getData(), byteOffset, value); #elseif neko + if (value == null) value = 0; untyped __dollar__sset(buffer.b, byteOffset, value & 0xff); #else buffer.set(byteOffset, value); @@ -427,6 +428,9 @@ abstract TypedArrayType(Int) from Int to Int { #if cpp untyped __global__.__hxcpp_memory_set_byte(buffer.getData(), byteOffset, value); #else + #if neko + if (value == null) value = 0; + #end buffer.set( byteOffset, value ); #end @@ -474,6 +478,7 @@ abstract TypedArrayType(Int) from Int to Int { #if cpp untyped __global__.__hxcpp_memory_set_i16(buffer.getData(), byteOffset, value); #elseif neko + if (value == null) value = 0; untyped var b = buffer.b; untyped __dollar__sset(b, byteOffset , (value ) & 0xff); untyped __dollar__sset(b, byteOffset+1, (value >> 8) & 0xff); @@ -489,6 +494,7 @@ abstract TypedArrayType(Int) from Int to Int { #if cpp untyped __global__.__hxcpp_memory_set_i16(buffer.getData(), byteOffset, value); #elseif neko + if (value == null) value = 0; untyped var b = buffer.b; untyped __dollar__sset(b, byteOffset , (value >> 8) & 0xff); untyped __dollar__sset(b, byteOffset+1, (value ) & 0xff); @@ -608,6 +614,9 @@ abstract TypedArrayType(Int) from Int to Int { #if cpp untyped __global__.__hxcpp_memory_set_i32(buffer.getData(), byteOffset, value); #else + #if neko + if (value == null) value = 0; + #end #if (haxe_ver >= 3.2) buffer.setInt32(byteOffset,value); #else @@ -626,6 +635,9 @@ abstract TypedArrayType(Int) from Int to Int { #if cpp untyped __global__.__hxcpp_memory_set_i32(buffer.getData(), byteOffset, value); #else + #if neko + if (value == null) value = 0; + #end #if (haxe_ver >= 3.2) buffer.setInt32(byteOffset,value); #else @@ -711,6 +723,9 @@ abstract TypedArrayType(Int) from Int to Int { #if cpp untyped __global__.__hxcpp_memory_set_float(buffer.getData(), byteOffset, value); #else + #if neko + if (value == null) value = 0; + #end buffer.setFloat( byteOffset, value ); #end @@ -722,6 +737,9 @@ abstract TypedArrayType(Int) from Int to Int { #if cpp untyped __global__.__hxcpp_memory_set_float(buffer.getData(), byteOffset, value); #else + #if neko + if (value == null) value = 0; + #end buffer.setFloat( byteOffset, value ); #end @@ -755,6 +773,9 @@ abstract TypedArrayType(Int) from Int to Int { #if cpp untyped __global__.__hxcpp_memory_set_double(buffer.getData(), byteOffset, value); #else + #if neko + if (value == null) value = 0; + #end buffer.setDouble( byteOffset, value ); #end @@ -766,6 +787,9 @@ abstract TypedArrayType(Int) from Int to Int { #if cpp untyped __global__.__hxcpp_memory_set_double(buffer.getData(), byteOffset, value); #else + #if neko + if (value == null) value = 0; + #end buffer.setDouble( byteOffset, value ); #end