[nostalgia/toos/pack] Cleanup
This commit is contained in:
parent
26a1f2e4ad
commit
535480ef26
@ -58,11 +58,10 @@ static ox::Error run(const ox::ClArgs &args) noexcept {
|
|||||||
}
|
}
|
||||||
ox::Buffer dstBuff(32 * ox::units::MB);
|
ox::Buffer dstBuff(32 * ox::units::MB);
|
||||||
oxReturnError(ox::FileSystem32::format(dstBuff.data(), dstBuff.size()));
|
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()));
|
ox::FileSystem32 dst(ox::FileStore32(dstBuff.data(), dstBuff.size()));
|
||||||
core::TypeStore ts(src.get());
|
const auto ctx = foundation::init(ox::make_unique<ox::PassThroughFS>(argSrc), "nost-pack");
|
||||||
auto ctx = foundation::init(std::move(src), "nost-pack");
|
core::TypeStore ts(ctx->rom.get());
|
||||||
oxReturnError(pack(ctx.get(), &ts, ctx->rom.get(), &dst));
|
oxReturnError(pack(ctx.get(), &ts, &dst));
|
||||||
oxRequireM(pl, GbaPreloader::make());
|
oxRequireM(pl, GbaPreloader::make());
|
||||||
oxReturnError(preload(&ts, &dst, pl.get()));
|
oxReturnError(preload(&ts, &dst, pl.get()));
|
||||||
oxReturnError(dst.resize());
|
oxReturnError(dst.resize());
|
||||||
|
@ -204,8 +204,8 @@ ox::Error appendBinary(ox::Buffer *binBuff, ox::Buffer *fsBuff, GbaPreloader *pl
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::Error pack(foundation::Context *ctx, core::TypeStore *ts, ox::FileSystem *src, ox::FileSystem *dest) noexcept {
|
ox::Error pack(foundation::Context *ctx, core::TypeStore *ts, ox::FileSystem *dest) noexcept {
|
||||||
oxReturnError(copy(src, dest, "/"));
|
oxReturnError(copy(ctx->rom.get(), dest, "/"));
|
||||||
oxReturnError(ox::buildTypeDef<core::CompactTileSheet>(ts));
|
oxReturnError(ox::buildTypeDef<core::CompactTileSheet>(ts));
|
||||||
oxReturnError(transformClaw(ctx, ts, dest, "/"));
|
oxReturnError(transformClaw(ctx, ts, dest, "/"));
|
||||||
return {};
|
return {};
|
||||||
|
@ -95,7 +95,7 @@ using GbaPreloader = ox::Preloader<GbaPlatSpec>;
|
|||||||
|
|
||||||
ox::Error appendBinary(ox::Buffer *binBuff, ox::Buffer *fsBuff, GbaPreloader *pl) noexcept;
|
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;
|
auto preload(core::TypeStore *ts, ox::FileSystem *src, GbaPreloader *ph) noexcept -> ox::Error;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user