diff --git a/src/nostalgia/core/userland/gfx.cpp b/src/nostalgia/core/userland/gfx.cpp index a4761371..e94c8831 100644 --- a/src/nostalgia/core/userland/gfx.cpp +++ b/src/nostalgia/core/userland/gfx.cpp @@ -14,19 +14,10 @@ namespace nostalgia::core { -static ox::Result> readFile(Context *ctx, const ox::FileAddress &file) noexcept { - oxRequire(stat, ctx->rom->stat(file)); - ox::Vector buff(stat.size); - oxReturnError(ctx->rom->read(file, buff.data(), buff.size())); - return ox::move(buff); -} - template -ox::Result readObj(Context *ctx, const ox::FileAddress &file) noexcept { - oxRequire(buff, readFile(ctx, file)); - T t; - oxReturnError(ox::readClaw(buff.data(), buff.size(), &t)); - return ox::move(t); +static ox::Result readObj(Context *ctx, const ox::FileAddress &file) noexcept { + oxRequire(buff, ctx->rom->read(file)); + return ox::readClaw(buff); } ox::Error initConsole(Context *ctx) noexcept {