[nostalgia] Fix for explicit ValErr::operator T

This commit is contained in:
Gary Talent 2019-07-30 23:08:40 -05:00
parent c27cc56e31
commit df8e1d31d6
2 changed files with 4 additions and 2 deletions

View File

@ -76,7 +76,7 @@ int Project::write(QString path, uint8_t *buff, size_t buffLen) const {
} }
ox::FileStat Project::stat(QString path) const { ox::FileStat Project::stat(QString path) const {
return m_fs.stat(path.toUtf8().data()); return m_fs.stat(path.toUtf8().data()).value;
} }
} }

View File

@ -110,7 +110,9 @@ using namespace nostalgia::common;
} }
ox::Error importTileSet(ox::FileSystem *fs, QString romPath, QString importPath) { ox::Error importTileSet(ox::FileSystem *fs, QString romPath, QString importPath) {
const auto bpp = countColors(importPath) > 16 ? 8 : 4; int colors = 0;
oxReturnError(countColors(importPath).get(&colors));
const auto bpp = colors > 16 ? 8 : 4;
auto [imgDataBuff, err] = convertImg(importPath, bpp); auto [imgDataBuff, err] = convertImg(importPath, bpp);
oxReturnError(err); oxReturnError(err);
return fs->write(romPath.toUtf8().data(), imgDataBuff.data(), imgDataBuff.size()); return fs->write(romPath.toUtf8().data(), imgDataBuff.data(), imgDataBuff.size());