diff options
| author | Pablo Andres Fuente <pfuente@heroku.com> | 2024-10-01 23:41:13 -0300 |
|---|---|---|
| committer | Pablo Andres Fuente <pablo.andres.fuente@gmail.com> | 2024-11-12 08:46:52 -0300 |
| commit | eb86670f94ef505e9b4adc37bc0948a3a5588ed8 (patch) | |
| tree | 5daa03dd78b80c77820e7e9ae203f909d02e9dab /doc/classes | |
| parent | ec6a1c0e792ac8be44990749800a4654a293b9ee (diff) | |
| download | redot-engine-eb86670f94ef505e9b4adc37bc0948a3a5588ed8.tar.gz | |
Add half precision floating point support to `StreamPeer`
Closes godotengine/godot-proposals#5983
Adds put/get methods to `StreamPeer` that handles half precision
floating point values.
Adds endode/decode half precision floating point to `marshalls`.
Adds `get_half` and `store_half` to `FileAccess`
Co-Authored-By: "Alfonso J. Ramos" <theraot@gmail.com>
Diffstat (limited to 'doc/classes')
| -rw-r--r-- | doc/classes/FileAccess.xml | 13 | ||||
| -rw-r--r-- | doc/classes/StreamPeer.xml | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/doc/classes/FileAccess.xml b/doc/classes/FileAccess.xml index b782937a8a..a8fb648f7b 100644 --- a/doc/classes/FileAccess.xml +++ b/doc/classes/FileAccess.xml @@ -173,6 +173,12 @@ Returns the next 32 bits from the file as a floating-point number. </description> </method> + <method name="get_half" qualifiers="const"> + <return type="float" /> + <description> + Returns the next 16 bits from the file as a half-precision floating-point number. + </description> + </method> <method name="get_hidden_attribute" qualifiers="static"> <return type="bool" /> <param index="0" name="file" type="String" /> @@ -470,6 +476,13 @@ Stores a floating-point number as 32 bits in the file. </description> </method> + <method name="store_half"> + <return type="void" /> + <param index="0" name="value" type="float" /> + <description> + Stores a half-precision floating-point number as 16 bits in the file. + </description> + </method> <method name="store_line"> <return type="void" /> <param index="0" name="line" type="String" /> diff --git a/doc/classes/StreamPeer.xml b/doc/classes/StreamPeer.xml index ad5c5472b8..acff5cf604 100644 --- a/doc/classes/StreamPeer.xml +++ b/doc/classes/StreamPeer.xml @@ -59,6 +59,12 @@ Gets a single-precision float from the stream. </description> </method> + <method name="get_half"> + <return type="float" /> + <description> + Gets a half-precision float from the stream. + </description> + </method> <method name="get_partial_data"> <return type="Array" /> <param index="0" name="bytes" type="int" /> @@ -162,6 +168,13 @@ Puts a single-precision float into the stream. </description> </method> + <method name="put_half"> + <return type="void" /> + <param index="0" name="value" type="float" /> + <description> + Puts a half-precision float into the stream. + </description> + </method> <method name="put_partial_data"> <return type="Array" /> <param index="0" name="data" type="PackedByteArray" /> |
