From eb86670f94ef505e9b4adc37bc0948a3a5588ed8 Mon Sep 17 00:00:00 2001 From: Pablo Andres Fuente Date: Tue, 1 Oct 2024 23:41:13 -0300 Subject: 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" --- doc/classes/FileAccess.xml | 13 +++++++++++++ doc/classes/StreamPeer.xml | 13 +++++++++++++ 2 files changed, 26 insertions(+) (limited to 'doc/classes') 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. + + + + Returns the next 16 bits from the file as a half-precision floating-point number. + + @@ -470,6 +476,13 @@ Stores a floating-point number as 32 bits in the file. + + + + + Stores a half-precision floating-point number as 16 bits in the file. + + 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. + + + + Gets a half-precision float from the stream. + + @@ -162,6 +168,13 @@ Puts a single-precision float into the stream. + + + + + Puts a half-precision float into the stream. + + -- cgit v1.2.3