Skip to content

Commit

Permalink
Upgrade to fmt v10; fix access to c_str in wld
Browse files Browse the repository at this point in the history
  • Loading branch information
spoutn1k committed Apr 2, 2024
1 parent eb63c00 commit e77c3cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/colors.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <logger.hpp>
#include <map>
#include <string>
#include <fmt/core.h>

using nlohmann::json;
using std::list;
Expand Down Expand Up @@ -220,7 +221,7 @@ void from_json(const json &j, Palette &p);

} // namespace Colors

template <> struct fmt::formatter<Colors::Color> {
template <> struct fmt::formatter<Colors::Color> : formatter<string_view> {
char presentation = 'c';
constexpr auto parse(format_parse_context &ctx) {
auto it = ctx.begin(), end = ctx.end();
Expand All @@ -236,8 +237,7 @@ template <> struct fmt::formatter<Colors::Color> {
return it;
}

template <typename FormatContext>
auto format(const Colors::Color &c, FormatContext &ctx) {
auto format(const Colors::Color &c, format_context &ctx) const {
if (c.ALPHA == 0xff)
return format_to(ctx.out(), "#{:02x}{:02x}{:02x}", c.R, c.G, c.B);
else
Expand Down
2 changes: 1 addition & 1 deletion src/worldloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void Data::loadChunk(const ChunkCoordinates coords) {
if (!nbt::parse(chunkBuffer, length, data) || !Chunk::assert_chunk(data)) {
fclose(regionHandle);
logger::trace("Chunk parsing failed for chunk {} {} in {}", coords.x,
coords.z, regionFile.c_str());
coords.z, regionFile.string());
return;
}

Expand Down

0 comments on commit e77c3cd

Please sign in to comment.