From 20818c12b79829f6101e15b21e92ee05f25f56e7 Mon Sep 17 00:00:00 2001 From: ChristopheClaustre Date: Sat, 17 Jul 2021 00:36:45 +0200 Subject: New to_***_array method to decode PackedByteArray to Packed***Array Documentation for new PackedByteArray::to_***_array methods Documentation for to_byte_array method for PackedInt32/Int64/Float32/Float64Array --- doc/classes/PackedByteArray.xml | 36 ++++++++++++++++++++++++++++++++++++ doc/classes/PackedFloat32Array.xml | 2 ++ doc/classes/PackedFloat64Array.xml | 2 ++ doc/classes/PackedInt32Array.xml | 2 ++ doc/classes/PackedInt64Array.xml | 2 ++ 5 files changed, 44 insertions(+) (limited to 'doc') diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index 0652cf0aa1..82bfa14ded 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -515,6 +515,42 @@ Returns the slice of the [PackedByteArray] between indices (inclusive) as a new [PackedByteArray]. Any negative index is considered to be from the end of the array. + + + + + Returns a copy of the data converted to a [PackedFloat32Array], where each block of 4 bytes has been converted to a 32-bit float (C++ [code]float[/code]). + The size of the new array will be [code]byte_array.size() / 4[/code]. + If the original data can't be converted to 32-bit floats, the resulting data is undefined. + + + + + + + Returns a copy of the data converted to a [PackedFloat64Array], where each block of 8 bytes has been converted to a 64-bit float (C++ [code]double[/code], Godot [float]). + The size of the new array will be [code]byte_array.size() / 8[/code]. + If the original data can't be converted to 64-bit floats, the resulting data is undefined. + + + + + + + Returns a copy of the data converted to a [PackedInt32Array], where each block of 4 bytes has been converted to a signed 32-bit integer (C++ [code]int32_t[/code]). + The size of the new array will be [code]byte_array.size() / 4[/code]. + If the original data can't be converted to signed 32-bit integers, the resulting data is undefined. + + + + + + + Returns a copy of the data converted to a [PackedInt64Array], where each block of 4 bytes has been converted to a signed 64-bit integer (C++ [code]int64_t[/code], Godot [int]). + The size of the new array will be [code]byte_array.size() / 8[/code]. + If the original data can't be converted to signed 64-bit integers, the resulting data is undefined. + + diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index ab97c9a695..663aeeb21d 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -201,6 +201,8 @@ + Returns a copy of the data converted to a [PackedByteArray], where each element have been encoded as 4 bytes. + The size of the new array will be [code]float32_array.size() * 4[/code]. diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index ad20801b01..bf2200f5bb 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -201,6 +201,8 @@ + Returns a copy of the data converted to a [PackedByteArray], where each element have been encoded as 8 bytes. + The size of the new array will be [code]float64_array.size() * 8[/code]. diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index ff4729082e..c587126d50 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -201,6 +201,8 @@ + Returns a copy of the data converted to a [PackedByteArray], where each element have been encoded as 4 bytes. + The size of the new array will be [code]int32_array.size() * 4[/code]. diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index 195b12b129..a9ebc80601 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -201,6 +201,8 @@ + Returns a copy of the data converted to a [PackedByteArray], where each element have been encoded as 8 bytes. + The size of the new array will be [code]int64_array.size() * 8[/code]. -- cgit v1.2.3