[nostalgia/tools/pack] Add Bullock integration and cleanup FS access
This commit is contained in:
@@ -32,7 +32,7 @@ static ox::Error pathToInode(ox::FileSystem *dest, ox::ModelObject *obj) noexcep
|
||||
case ox::FileAddressType::None:
|
||||
return {};
|
||||
}
|
||||
oxRequire(s, dest->stat(ox::StringView(path)));
|
||||
oxRequire(s, dest->stat(path));
|
||||
oxReturnError(o["type"].set(static_cast<int8_t>(ox::FileAddressType::Inode)));
|
||||
return data.set(2, s.inode);
|
||||
}
|
||||
@@ -121,7 +121,7 @@ static ox::Error copy(ox::FileSystem *src, ox::FileSystem *dest, ox::CRStringVie
|
||||
continue;
|
||||
}
|
||||
oxOutf("reading {}\n", currentFile);
|
||||
oxRequire(stat, src->stat(ox::StringView(currentFile)));
|
||||
oxRequire(stat, src->stat(currentFile));
|
||||
if (stat.fileType == ox::FileType::Directory) {
|
||||
oxReturnError(dest->mkdir(currentFile, true));
|
||||
oxReturnError(copy(src, dest, currentFile + '/'));
|
||||
@@ -171,7 +171,7 @@ static ox::Error preloadDir(core::TypeStore *ts, ox::FileSystem *romFs, GbaPrelo
|
||||
oxRequire(fileList, romFs->ls(path));
|
||||
for (const auto &name : fileList) {
|
||||
const auto filePath = ox::sfmt("{}{}", path, name);
|
||||
oxRequire(stat, romFs->stat(ox::StringView(filePath)));
|
||||
oxRequire(stat, romFs->stat(filePath));
|
||||
if (stat.fileType == ox::FileType::Directory) {
|
||||
const auto dir = ox::sfmt("{}{}/", path, name);
|
||||
oxReturnError(preloadDir(ts, romFs, pl, dir));
|
||||
|
||||
Reference in New Issue
Block a user