Skip to content

Commit

Permalink
make unpacker return metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
qnnnnez committed Apr 21, 2017
1 parent d3b571a commit 2254e2b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 529 deletions.
2 changes: 1 addition & 1 deletion pack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ namespace scpak
throw std::runtime_error("image must have 4 components in every pixel: " + item.name);
int mipmapLevel = 0;
if (!meta.empty())
std::stringstream(meta) >> mipmapLevel;
mipmapLevel = std::stoi(meta);
item.length = sizeof(int) * 3 + calcMipmapSize(width, height, mipmapLevel) * comp;
item.data.resize(item.length);
*reinterpret_cast<int*>(item.data.data()) = width;
Expand Down
Loading

0 comments on commit 2254e2b

Please sign in to comment.