diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-05-20 14:58:03 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-05-20 14:58:03 +0200 |
commit | 12462d9055bded888ae5ced2e121e667b3e0e0e3 (patch) | |
tree | 6b8f52e6ca663d69b4e5e5c004c1cefdbd361be3 /core/io | |
parent | 342f3efc7ec41f3a4e439c0c0e6a2d0f0f2fbe41 (diff) |
Rename File's `endian_swap` to `big_endian`
This new name is more consistent with ResourceSaver and StreamPeer.
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/file_access_pack.cpp | 6 | ||||
-rw-r--r-- | core/io/file_access_pack.h | 2 | ||||
-rw-r--r-- | core/io/resource_format_binary.cpp | 10 | ||||
-rw-r--r-- | core/io/stream_peer.cpp | 4 | ||||
-rw-r--r-- | core/io/stream_peer.h | 2 |
5 files changed, 12 insertions, 12 deletions
diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index 3e1c51b733..958c7232b8 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -320,9 +320,9 @@ uint64_t FileAccessPack::get_buffer(uint8_t *p_dst, uint64_t p_length) const { return to_read; } -void FileAccessPack::set_endian_swap(bool p_swap) { - FileAccess::set_endian_swap(p_swap); - f->set_endian_swap(p_swap); +void FileAccessPack::set_big_endian(bool p_big_endian) { + FileAccess::set_big_endian(p_big_endian); + f->set_big_endian(p_big_endian); } Error FileAccessPack::get_error() const { diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h index e47c9ea543..f03b77681d 100644 --- a/core/io/file_access_pack.h +++ b/core/io/file_access_pack.h @@ -171,7 +171,7 @@ public: virtual uint64_t get_buffer(uint8_t *p_dst, uint64_t p_length) const; - virtual void set_endian_swap(bool p_swap); + virtual void set_big_endian(bool p_big_endian); virtual Error get_error() const; diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 50c9b2371a..d6601513bc 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -851,7 +851,7 @@ void ResourceLoaderBinary::open(FileAccess *p_f) { bool big_endian = f->get_32(); bool use_real64 = f->get_32(); - f->set_endian_swap(big_endian != 0); //read big endian if saved as big endian + f->set_big_endian(big_endian != 0); //read big endian if saved as big endian uint32_t ver_major = f->get_32(); uint32_t ver_minor = f->get_32(); @@ -948,7 +948,7 @@ String ResourceLoaderBinary::recognize(FileAccess *p_f) { bool big_endian = f->get_32(); f->get_32(); // use_real64 - f->set_endian_swap(big_endian != 0); //read big endian if saved as big endian + f->set_big_endian(big_endian != 0); //read big endian if saved as big endian uint32_t ver_major = f->get_32(); f->get_32(); // ver_minor @@ -1097,13 +1097,13 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons bool big_endian = f->get_32(); bool use_real64 = f->get_32(); - f->set_endian_swap(big_endian != 0); //read big endian if saved as big endian + f->set_big_endian(big_endian != 0); //read big endian if saved as big endian #ifdef BIG_ENDIAN_ENABLED fw->store_32(!big_endian); #else fw->store_32(big_endian); #endif - fw->set_endian_swap(big_endian != 0); + fw->set_big_endian(big_endian != 0); fw->store_32(use_real64); //use real64 uint32_t ver_major = f->get_32(); @@ -1798,7 +1798,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p if (big_endian) { f->store_32(1); - f->set_endian_swap(true); + f->set_big_endian(true); } else { f->store_32(0); } diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index 74154321b3..ee5e9eca0c 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -108,8 +108,8 @@ Array StreamPeer::_get_partial_data(int p_bytes) { return ret; } -void StreamPeer::set_big_endian(bool p_enable) { - big_endian = p_enable; +void StreamPeer::set_big_endian(bool p_big_endian) { + big_endian = p_big_endian; } bool StreamPeer::is_big_endian_enabled() const { diff --git a/core/io/stream_peer.h b/core/io/stream_peer.h index dadedbd2dc..1e1a3e890c 100644 --- a/core/io/stream_peer.h +++ b/core/io/stream_peer.h @@ -58,7 +58,7 @@ public: virtual int get_available_bytes() const = 0; - void set_big_endian(bool p_enable); + void set_big_endian(bool p_big_endian); bool is_big_endian_enabled() const; void put_8(int8_t p_val); |