[nostalgia/tools/pack] Fix nost-pack to pass in proper Context

This commit is contained in:
2023-02-03 01:54:56 -06:00
parent 7868b0678f
commit 8bcffc73ff
4 changed files with 23 additions and 12 deletions
+5 -3
View File
@@ -10,6 +10,7 @@
#include <nostalgia/appmodules/appmodules.hpp>
#include <nostalgia/core/typestore.hpp>
#include <nostalgia/foundation/foundation.hpp>
#include "pack/pack.hpp"
@@ -57,10 +58,11 @@ static ox::Error run(const ox::ClArgs &args) noexcept {
}
ox::Buffer dstBuff(32 * ox::units::MB);
oxReturnError(ox::FileSystem32::format(dstBuff.data(), dstBuff.size()));
ox::PassThroughFS src(argSrc);
auto src = ox::make_unique<ox::PassThroughFS>(argSrc);
ox::FileSystem32 dst(ox::FileStore32(dstBuff.data(), dstBuff.size()));
core::TypeStore ts(&src);
oxReturnError(pack(&ts, &src, &dst));
core::TypeStore ts(src.get());
auto ctx = foundation::init(std::move(src), "nost-pack");
oxReturnError(pack(ctx.get(), &ts, ctx->rom.get(), &dst));
oxRequireM(pl, GbaPreloader::make());
oxReturnError(preload(&ts, &dst, pl.get()));
oxReturnError(dst.resize());