Skip to content

Commit

Permalink
feat(engine): remove no longer relevant comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Dacops committed Jan 30, 2024
1 parent eabe308 commit 9108172
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/lib/json
Submodule json updated 286 files
8 changes: 4 additions & 4 deletions engine/include/cubos/engine/assets/bridges/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9108172

Please sign in to comment.