From 4ce18766cd2c60058d06c5e11bc802441114473e Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Wed, 24 Mar 2021 22:40:33 -0500 Subject: [PATCH] [nostalgia/core/userland] Remove unnecessary copies --- src/nostalgia/core/userland/gfx.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nostalgia/core/userland/gfx.cpp b/src/nostalgia/core/userland/gfx.cpp index 2b20a7e6..b2bfb382 100644 --- a/src/nostalgia/core/userland/gfx.cpp +++ b/src/nostalgia/core/userland/gfx.cpp @@ -18,7 +18,7 @@ static ox::Result> readFile(Context *ctx, const ox::FileAddress oxRequire(stat, ctx->rom->stat(file)); ox::Vector buff(stat.size); oxReturnError(ctx->rom->read(file, buff.data(), buff.size())); - return buff; + return ox::move(buff); } template @@ -26,13 +26,14 @@ ox::Result readObj(Context *ctx, const ox::FileAddress &file) { oxRequire(buff, readFile(ctx, file)); T t; oxReturnError(ox::readClaw(buff.data(), buff.size(), &t)); - return t; + return ox::move(t); } ox::Error initConsole(Context *ctx) { constexpr auto TilesheetAddr = "/TileSheets/Charset.ng"; + constexpr auto PaletteAddr = "/Palettes/Charset.npal"; setBgStatus(ctx, 0b0001); - return loadBgTileSheet(ctx, 0, TilesheetAddr); + return loadBgTileSheet(ctx, 0, TilesheetAddr, PaletteAddr); } ox::Error loadSpriteTileSheet(Context*,