mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 22:53:43 +00:00
[feature] Added Feature V1 version with free Header2 bits.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
588028c9eb
commit
550455a14a
@@ -10,13 +10,13 @@ public:
|
||||
enum class Version : uint8_t
|
||||
{
|
||||
V0 = 0,
|
||||
Latest = V0
|
||||
V1, // 2025.06, get some free bits in Feature::Header2
|
||||
Latest = V1
|
||||
};
|
||||
|
||||
template <typename Sink>
|
||||
void Serialize(Sink & sink) const
|
||||
{
|
||||
CHECK_EQUAL(m_version, Version::V0, ());
|
||||
WriteToSink(sink, static_cast<uint8_t>(m_version));
|
||||
WriteToSink(sink, m_featuresOffset);
|
||||
WriteToSink(sink, m_featuresSize);
|
||||
@@ -26,7 +26,8 @@ public:
|
||||
void Read(Source & source)
|
||||
{
|
||||
m_version = static_cast<Version>(ReadPrimitiveFromSource<uint8_t>(source));
|
||||
CHECK_EQUAL(static_cast<uint8_t>(m_version), static_cast<uint8_t>(Version::V0), ());
|
||||
CHECK(Version::V0 <= m_version && m_version <= Version::Latest, (m_version));
|
||||
|
||||
m_featuresOffset = ReadPrimitiveFromSource<uint32_t>(source);
|
||||
m_featuresSize = ReadPrimitiveFromSource<uint32_t>(source);
|
||||
}
|
||||
@@ -39,7 +40,10 @@ public:
|
||||
|
||||
inline std::string DebugPrint(DatSectionHeader::Version v)
|
||||
{
|
||||
CHECK(v == DatSectionHeader::Version::V0, ());
|
||||
return "V0";
|
||||
switch (v)
|
||||
{
|
||||
case DatSectionHeader::Version::V0: return "V0";
|
||||
default: return "Latest(V1)";
|
||||
}
|
||||
}
|
||||
} // namespace feature
|
||||
|
||||
Reference in New Issue
Block a user