diff --git a/src/nostalgia/core/sdl/CMakeLists.txt b/src/nostalgia/core/sdl/CMakeLists.txt index f28a218b..5f48099e 100644 --- a/src/nostalgia/core/sdl/CMakeLists.txt +++ b/src/nostalgia/core/sdl/CMakeLists.txt @@ -9,6 +9,7 @@ find_package(sdl2 REQUIRED) target_link_libraries( NostalgiaCore-SDL PUBLIC sdl2::sdl2 + OxClaw OxFS OxStd NostalgiaCore-Userspace diff --git a/src/nostalgia/core/sdl/gfx.cpp b/src/nostalgia/core/sdl/gfx.cpp index 76136921..b2a51085 100644 --- a/src/nostalgia/core/sdl/gfx.cpp +++ b/src/nostalgia/core/sdl/gfx.cpp @@ -14,7 +14,7 @@ #include -#include +#include #include @@ -31,20 +31,20 @@ struct SdlImplData { uint64_t draws = 0; }; -[[nodiscard]] static ox::ValErr> readFile(Context *ctx, const ox::FileAddress &file) { +[[nodiscard]] static ox::ValErr> readFile(Context *ctx, const ox::FileAddress &file) { auto [stat, err] = ctx->rom->stat(file); oxReturnError(err); - ox::Vector buff(stat.size); + ox::Vector buff(stat.size); oxReturnError(ctx->rom->read(file, buff.data(), buff.size())); return buff; } template -[[nodiscard]] ox::ValErr readMC(Context *ctx, const ox::FileAddress &file) { +[[nodiscard]] ox::ValErr readObj(Context *ctx, const ox::FileAddress &file) { auto [buff, err] = readFile(ctx, file); oxReturnError(err); T t; - oxReturnError(ox::readMC(buff.data(), buff.size(), &t)); + oxReturnError(ox::readClaw(buff.data(), buff.size(), &t)); return t; } @@ -97,13 +97,13 @@ ox::Error loadTileSheet(Context *ctx, ox::FileAddress tilesheetPath, ox::FileAddress palettePath) { auto id = ctx->implData(); - auto [tilesheet, tserr] = readMC(ctx, tilesheetPath); + auto [tilesheet, tserr] = readObj(ctx, tilesheetPath); oxReturnError(tserr); NostalgiaPalette palette; if (!palettePath) { palettePath = tilesheet.defaultPalette; } - oxReturnError(readMC(ctx, palettePath).get(&palette)); + oxReturnError(readObj(ctx, palettePath).get(&palette)); const unsigned bytesPerTile = tilesheet.bpp == 8 ? 64 : 32; const auto tiles = tilesheet.tiles.size() / bytesPerTile;