[nostalgia/toos/pack] Cleanup

This commit is contained in:
Gary Talent 2023-02-03 02:04:33 -06:00
parent 26a1f2e4ad
commit 535480ef26
3 changed files with 6 additions and 7 deletions

View File

@ -58,11 +58,10 @@ static ox::Error run(const ox::ClArgs &args) noexcept {
}
ox::Buffer dstBuff(32 * ox::units::MB);
oxReturnError(ox::FileSystem32::format(dstBuff.data(), dstBuff.size()));
auto src = ox::make_unique<ox::PassThroughFS>(argSrc);
ox::FileSystem32 dst(ox::FileStore32(dstBuff.data(), dstBuff.size()));
core::TypeStore ts(src.get());
auto ctx = foundation::init(std::move(src), "nost-pack");
oxReturnError(pack(ctx.get(), &ts, ctx->rom.get(), &dst));
const auto ctx = foundation::init(ox::make_unique<ox::PassThroughFS>(argSrc), "nost-pack");
core::TypeStore ts(ctx->rom.get());
oxReturnError(pack(ctx.get(), &ts, &dst));
oxRequireM(pl, GbaPreloader::make());
oxReturnError(preload(&ts, &dst, pl.get()));
oxReturnError(dst.resize());

View File

@ -204,8 +204,8 @@ ox::Error appendBinary(ox::Buffer *binBuff, ox::Buffer *fsBuff, GbaPreloader *pl
return {};
}
ox::Error pack(foundation::Context *ctx, core::TypeStore *ts, ox::FileSystem *src, ox::FileSystem *dest) noexcept {
oxReturnError(copy(src, dest, "/"));
ox::Error pack(foundation::Context *ctx, core::TypeStore *ts, ox::FileSystem *dest) noexcept {
oxReturnError(copy(ctx->rom.get(), dest, "/"));
oxReturnError(ox::buildTypeDef<core::CompactTileSheet>(ts));
oxReturnError(transformClaw(ctx, ts, dest, "/"));
return {};

View File

@ -95,7 +95,7 @@ using GbaPreloader = ox::Preloader<GbaPlatSpec>;
ox::Error appendBinary(ox::Buffer *binBuff, ox::Buffer *fsBuff, GbaPreloader *pl) noexcept;
auto pack(foundation::Context *ctx, core::TypeStore *ts, ox::FileSystem *src, ox::FileSystem *dest) noexcept -> ox::Error;
auto pack(foundation::Context *ctx, core::TypeStore *ts, ox::FileSystem *dest) noexcept -> ox::Error;
auto preload(core::TypeStore *ts, ox::FileSystem *src, GbaPreloader *ph) noexcept -> ox::Error;