summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/MapSerializer.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2024-11-02 22:27:47 +0100
committerAlexander Harkness <me@bearbin.net>2024-11-02 22:27:47 +0100
commitcb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a (patch)
treef647b20e1823f1846af88e832cf82a4a02e96e69 /src/WorldStorage/MapSerializer.cpp
parentImprove clang-format config file, remove automatically enforced code style from contrib guide. (diff)
downloadcuberite-clang-format-codebase.tar
cuberite-clang-format-codebase.tar.gz
cuberite-clang-format-codebase.tar.bz2
cuberite-clang-format-codebase.tar.lz
cuberite-clang-format-codebase.tar.xz
cuberite-clang-format-codebase.tar.zst
cuberite-clang-format-codebase.zip
Diffstat (limited to 'src/WorldStorage/MapSerializer.cpp')
-rw-r--r--src/WorldStorage/MapSerializer.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/WorldStorage/MapSerializer.cpp b/src/WorldStorage/MapSerializer.cpp
index 3e50740b3..8761495a9 100644
--- a/src/WorldStorage/MapSerializer.cpp
+++ b/src/WorldStorage/MapSerializer.cpp
@@ -14,7 +14,7 @@
-cMapSerializer::cMapSerializer(const AString & a_WorldName, cMap * a_Map):
+cMapSerializer::cMapSerializer(const AString & a_WorldName, cMap * a_Map) :
m_Map(a_Map)
{
auto DataPath = fmt::format(FMT_STRING("{}{}data"), a_WorldName, cFile::PathSeparator());
@@ -50,10 +50,10 @@ bool cMapSerializer::Save(void)
SaveMapToNBT(Writer);
Writer.Finish();
- #ifndef NDEBUG
+#ifndef NDEBUG
cParsedNBT TestParse(Writer.GetResult());
ASSERT(TestParse.IsValid());
- #endif // !NDEBUG
+#endif // !NDEBUG
GZipFile::Write(m_Path, Writer.GetResult());
@@ -71,7 +71,7 @@ void cMapSerializer::SaveMapToNBT(cFastNBTWriter & a_Writer)
a_Writer.AddByte("scale", static_cast<Byte>(m_Map->GetScale()));
a_Writer.AddByte("dimension", static_cast<Byte>(m_Map->GetDimension()));
- a_Writer.AddShort("width", static_cast<Int16>(m_Map->GetWidth()));
+ a_Writer.AddShort("width", static_cast<Int16>(m_Map->GetWidth()));
a_Writer.AddShort("height", static_cast<Int16>(m_Map->GetHeight()));
a_Writer.AddInt("xCenter", m_Map->GetCenterX());
@@ -166,7 +166,8 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT)
-cIDCountSerializer::cIDCountSerializer(const AString & a_WorldName) : m_MapCount(0)
+cIDCountSerializer::cIDCountSerializer(const AString & a_WorldName) :
+ m_MapCount(0)
{
auto DataPath = fmt::format(FMT_STRING("{}{}data"), a_WorldName, cFile::PathSeparator());
m_Path = fmt::format(FMT_STRING("{}{}idcounts.dat"), DataPath, cFile::PathSeparator());
@@ -188,7 +189,7 @@ bool cIDCountSerializer::Load()
// NOTE: idcounts.dat is not compressed (raw format)
// Parse the NBT data:
- cParsedNBT NBT({ reinterpret_cast<const std::byte *>(Data.data()), Data.size() });
+ cParsedNBT NBT({reinterpret_cast<const std::byte *>(Data.data()), Data.size()});
if (!NBT.IsValid())
{
// NBT Parsing failed
@@ -223,10 +224,10 @@ bool cIDCountSerializer::Save(void)
Writer.Finish();
- #ifndef NDEBUG
+#ifndef NDEBUG
cParsedNBT TestParse(Writer.GetResult());
ASSERT(TestParse.IsValid());
- #endif // !NDEBUG
+#endif // !NDEBUG
cFile File;
if (!File.Open(m_Path, cFile::fmWrite))