1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Rename SAWYER_ENCODING and its members

This commit is contained in:
Gymnasiast
2025-03-26 12:09:45 +01:00
parent 5b7793f77b
commit 867b69a0f6
5 changed files with 14 additions and 14 deletions

View File

@@ -13,7 +13,7 @@
namespace OpenRCT2
{
SawyerChunk::SawyerChunk(SAWYER_ENCODING encoding, MemoryStream&& data)
SawyerChunk::SawyerChunk(SawyerEncoding encoding, MemoryStream&& data)
: _data(std::move(data))
, _encoding(encoding)
{

View File

@@ -18,12 +18,12 @@ namespace OpenRCT2
/**
* The type of encoding / compression for a sawyer encoded chunk.
*/
enum class SAWYER_ENCODING : uint8_t
enum class SawyerEncoding : uint8_t
{
NONE,
RLE,
RLECOMPRESSED,
ROTATE,
none,
rle,
rleCompressed,
rotate,
};
/**
@@ -33,7 +33,7 @@ namespace OpenRCT2
{
private:
OpenRCT2::MemoryStream _data;
SAWYER_ENCODING _encoding = SAWYER_ENCODING::NONE;
SawyerEncoding _encoding = SawyerEncoding::none;
public:
const void* GetData() const
@@ -44,11 +44,11 @@ namespace OpenRCT2
{
return _data.GetLength();
}
SAWYER_ENCODING GetEncoding() const
SawyerEncoding GetEncoding() const
{
return _encoding;
}
SawyerChunk(SAWYER_ENCODING encoding, OpenRCT2::MemoryStream&& data);
SawyerChunk(SawyerEncoding encoding, OpenRCT2::MemoryStream&& data);
};
} // namespace OpenRCT2

View File

@@ -75,7 +75,7 @@ namespace OpenRCT2
throw SawyerChunkException(EXCEPTION_MSG_ZERO_SIZED_CHUNK);
}
return std::make_shared<SawyerChunk>(static_cast<SAWYER_ENCODING>(header.encoding), std::move(buffer));
return std::make_shared<SawyerChunk>(static_cast<SawyerEncoding>(header.encoding), std::move(buffer));
}
default:
throw SawyerChunkException(EXCEPTION_MSG_INVALID_CHUNK_ENCODING);
@@ -114,7 +114,7 @@ namespace OpenRCT2
{
throw SawyerChunkException(EXCEPTION_MSG_ZERO_SIZED_CHUNK);
}
return std::make_shared<SawyerChunk>(SAWYER_ENCODING::RLE, std::move(buffer));
return std::make_shared<SawyerChunk>(SawyerEncoding::rle, std::move(buffer));
}
catch (const std::exception&)
{

View File

@@ -28,7 +28,7 @@ namespace OpenRCT2
WriteChunk(chunk->GetData(), chunk->GetLength(), chunk->GetEncoding());
}
void SawyerChunkWriter::WriteChunk(const void* src, size_t length, SAWYER_ENCODING encoding)
void SawyerChunkWriter::WriteChunk(const void* src, size_t length, SawyerEncoding encoding)
{
SawyerCoding::ChunkHeader header;
header.encoding = static_cast<uint8_t>(encoding);

View File

@@ -39,7 +39,7 @@ namespace OpenRCT2
* @param src The source buffer.
* @param length The size of the source buffer.
*/
void WriteChunk(const void* src, size_t length, SAWYER_ENCODING encoding);
void WriteChunk(const void* src, size_t length, SawyerEncoding encoding);
/**
* Writes a track chunk to the stream containing the given buffer.
@@ -52,7 +52,7 @@ namespace OpenRCT2
* Writes a chunk to the stream containing the given type.
*/
template<typename T>
void WriteChunk(const T* src, SAWYER_ENCODING encoding)
void WriteChunk(const T* src, SawyerEncoding encoding)
{
WriteChunk(src, sizeof(T), encoding);
}