Skip to content

Commit 2254e2b

Browse files
committed
make unpacker return metadata
1 parent d3b571a commit 2254e2b

File tree

5 files changed

+11
-529
lines changed

5 files changed

+11
-529
lines changed

pack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ namespace scpak
210210
throw std::runtime_error("image must have 4 components in every pixel: " + item.name);
211211
int mipmapLevel = 0;
212212
if (!meta.empty())
213-
std::stringstream(meta) >> mipmapLevel;
213+
mipmapLevel = std::stoi(meta);
214214
item.length = sizeof(int) * 3 + calcMipmapSize(width, height, mipmapLevel) * comp;
215215
item.data.resize(item.length);
216216
*reinterpret_cast<int*>(item.data.data()) = width;

0 commit comments

Comments
 (0)