mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-06-18 18:56:36 +02:00
fix due to spdlog(fmt) and json updates
implement workaround until https://github.com/nlohmann/json/issues/4261 gets fixed
This commit is contained in:
@ -1,5 +1,4 @@
|
|||||||
#include "./organizer_scene.hpp"
|
#include "./organizer_scene.hpp"
|
||||||
#include "mm/engine.hpp"
|
|
||||||
|
|
||||||
#include <mm/components/time_delta.hpp>
|
#include <mm/components/time_delta.hpp>
|
||||||
|
|
||||||
@ -35,6 +34,8 @@ static std::ostream& operator<<(std::ostream& out, const std::vector<entt::organ
|
|||||||
|
|
||||||
} // entt
|
} // entt
|
||||||
|
|
||||||
|
template <> struct fmt::formatter<std::vector<entt::organizer::vertex>> : fmt::ostream_formatter {};
|
||||||
|
|
||||||
namespace MM::Services {
|
namespace MM::Services {
|
||||||
|
|
||||||
bool OrganizerSceneService::enable(Engine& engine, std::vector<UpdateStrategies::TaskInfo>& task_array) {
|
bool OrganizerSceneService::enable(Engine& engine, std::vector<UpdateStrategies::TaskInfo>& task_array) {
|
||||||
@ -119,7 +120,7 @@ void OrganizerSceneService::changeSceneNow(std::unique_ptr<Scene>&& new_scene) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OrganizerSceneService::updateOrganizerVertices(Scene& scene) {
|
void OrganizerSceneService::updateOrganizerVertices(Scene& scene) {
|
||||||
scene.ctx().emplace<std::vector<entt::organizer::vertex>>() =
|
const auto& graph = scene.ctx().emplace<std::vector<entt::organizer::vertex>>() =
|
||||||
scene.ctx().emplace<entt::organizer>().graph();
|
scene.ctx().emplace<entt::organizer>().graph();
|
||||||
|
|
||||||
if (!scene.ctx().contains<MM::Components::TimeDelta>()) {
|
if (!scene.ctx().contains<MM::Components::TimeDelta>()) {
|
||||||
@ -127,7 +128,7 @@ void OrganizerSceneService::updateOrganizerVertices(Scene& scene) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: use entt::dot instead
|
// TODO: use entt::dot instead
|
||||||
SPDLOG_DEBUG("graph:\n{}", scene.ctx().get<std::vector<entt::organizer::vertex>>());
|
SPDLOG_DEBUG("graph:\n{}", graph);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OrganizerSceneService::resetTime(void) {
|
void OrganizerSceneService::resetTime(void) {
|
||||||
|
@ -25,6 +25,11 @@
|
|||||||
#define LOG_DEBUG(...) __LOG_DEBUG("Tilemap", __VA_ARGS__)
|
#define LOG_DEBUG(...) __LOG_DEBUG("Tilemap", __VA_ARGS__)
|
||||||
#define LOG_TRACE(...) __LOG_TRACE("Tilemap", __VA_ARGS__)
|
#define LOG_TRACE(...) __LOG_TRACE("Tilemap", __VA_ARGS__)
|
||||||
|
|
||||||
|
// HACK: https://github.com/nlohmann/json/issues/4261
|
||||||
|
namespace nlohmann {
|
||||||
|
auto format_as(const json& j) { return j.dump(); }
|
||||||
|
} // nlohmann
|
||||||
|
|
||||||
namespace MM {
|
namespace MM {
|
||||||
|
|
||||||
Tilemap::Tilemap(void) {
|
Tilemap::Tilemap(void) {
|
||||||
|
Reference in New Issue
Block a user