diff --git a/core/lib/glad b/core/lib/glad index 73eaae0aed..d08b1aa01f 160000 --- a/core/lib/glad +++ b/core/lib/glad @@ -1 +1 @@ -Subproject commit 73eaae0aed913cb22871698dc6728436c950ff94 +Subproject commit d08b1aa01f8fe57498f04d47b5fa8c48725be877 diff --git a/core/lib/json b/core/lib/json index 9cca280a4d..bc889afb4c 160000 --- a/core/lib/json +++ b/core/lib/json @@ -1 +1 @@ -Subproject commit 9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03 +Subproject commit bc889afb4c5bf1c0d8ee29ef35eaaf4c8bef8a5d diff --git a/engine/include/cubos/engine/assets/bridges/json.hpp b/engine/include/cubos/engine/assets/bridges/json.hpp index 6c047d1bd8..fe30b27628 100644 --- a/engine/include/cubos/engine/assets/bridges/json.hpp +++ b/engine/include/cubos/engine/assets/bridges/json.hpp @@ -37,11 +37,9 @@ namespace cubos::engine // Dump the file stream into a string and initialize a JSON deserializer with it. std::string jsonStr; stream.readUntil(jsonStr, nullptr); - core::data::JSONDeserializer deserializer{}; - // JSONDeserializer() receives a JSON object to deserialize from + // Parse JSON from the string. nlohmann::json json{}; - try { json = nlohmann::json::parse(jsonStr); @@ -51,6 +49,9 @@ namespace cubos::engine CUBOS_ERROR("{}", e.what()); return false; } + + // Feed the parsed JSON to a JSON deserializer. + core::data::JSONDeserializer deserializer{}; deserializer.feed(json); // Deserialize the asset and store it in the asset manager. @@ -78,7 +79,6 @@ namespace cubos::engine return false; } - // new JSONSerializer() does not receive a stream to write to, need to write to it manually auto jsonStr = serializer.output().dump(); stream.print(jsonStr); return true;