Skip to content

Commit

Permalink
print STBI error
Browse files Browse the repository at this point in the history
  • Loading branch information
Eisenwave committed Feb 6, 2021
1 parent 8fe6f05 commit 4f1a155
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ std::optional<Texture> loadTexture(const std::string &name, const std::string &m
return std::nullopt;
}

std::optional<Image> image = voxelio::png::decode(*stream, 4);
std::string err;
std::optional<Image> image = voxelio::png::decode(*stream, 4, err);
if (not stream.has_value()) {
VXIO_LOG(WARNING, "Could open, but failed to decode texture \"" + name + "\" of material \"" + material + '"');
VXIO_LOG(WARNING, "Caused by STBI error: " + err);
return std::nullopt;
}
image->setWrapMode(WrapMode::REPEAT);
Expand Down
2 changes: 1 addition & 1 deletion voxelio

0 comments on commit 4f1a155

Please sign in to comment.