From c5412becd1243536807f1f1af4ef4d40bedd438f Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 26 May 2023 12:56:07 +0200 Subject: Added cChunkCoords fmtlib formatter. --- src/ChunkDef.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/ChunkDef.h b/src/ChunkDef.h index ea2a3a06d..7d99ca6e8 100644 --- a/src/ChunkDef.h +++ b/src/ChunkDef.h @@ -52,6 +52,7 @@ typedef unsigned char HEIGHTTYPE; +/** Wraps the chunk coords into a single structure. */ class cChunkCoords { public: @@ -98,6 +99,22 @@ public: +/** Implements custom fmtlib formatting for cChunkCoords. */ +namespace fmt +{ + template <> struct formatter: formatter + { + auto format(cChunkCoords a_Coords, format_context & a_Ctx) + { + return format_to(a_Ctx.out(), "[{}, {}]", a_Coords.m_ChunkX, a_Coords.m_ChunkZ); + } + }; +} + + + + + /** Constants used throughout the code, useful typedefs and utility functions */ class cChunkDef { -- cgit v1.2.3