Skip to content

Commit

Permalink
update json loading for b296dfe
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Jun 27, 2017
1 parent b296dfe commit 52f914f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using json = nlohmann::json;
void LoadResources(const std::unique_ptr<SDL2pp::Renderer>& renderer,
const std::unique_ptr<ResourceManager>& resource_manager) {
std::ifstream ifs("resources/manifests/fonts.json");
json j(ifs);
json j = json::parse(ifs);

for (auto& f : j) {
if (static_cast<bool>(f.count("name")) &&
Expand All @@ -26,7 +26,7 @@ void LoadResources(const std::unique_ptr<SDL2pp::Renderer>& renderer,
}

std::ifstream ifs2("resources/manifests/spritesheets.json");
json j2(ifs2);
json j2 = json::parse(ifs2);

for (auto& f : j2) {
if (static_cast<bool>(f.count("name")) &&
Expand All @@ -52,7 +52,8 @@ void LoadResources(const std::unique_ptr<SDL2pp::Renderer>& renderer,
}

std::ifstream ifs3("resources/manifests/sprites.json");
json j3(ifs3);
json j3 = json::parse(ifs3);

for (auto& f : j3) {
auto name = f.find("name").value();
auto sheet = f.find("sheet").value();
Expand Down

0 comments on commit 52f914f

Please sign in to comment.