Compare commits
No commits in common. "5598dfdd873ac9a04366eded2b4333b018d8c108" and "9511cb57196b657912e3e7b55eeee95c9d673fbc" have entirely different histories.
5598dfdd87
...
9511cb5719
@ -65,7 +65,7 @@ static void testKeyEventHandler(turbine::Context &tctx, turbine::Key key, bool d
|
|||||||
|
|
||||||
[[maybe_unused]]
|
[[maybe_unused]]
|
||||||
static ox::Error runTest(turbine::Context &tctx) {
|
static ox::Error runTest(turbine::Context &tctx) {
|
||||||
constexpr ox::StringView TileSheetAddr{"/TileSheets/Charset.nts"};
|
constexpr ox::StringView TileSheetAddr{"/TileSheets/Charset.ng"};
|
||||||
constexpr ox::StringView PaletteAddr{"/Palettes/Chester.npal"};
|
constexpr ox::StringView PaletteAddr{"/Palettes/Chester.npal"};
|
||||||
OX_REQUIRE_M(cctx, gfx::init(tctx));
|
OX_REQUIRE_M(cctx, gfx::init(tctx));
|
||||||
turbine::setApplicationData(tctx, cctx.get());
|
turbine::setApplicationData(tctx, cctx.get());
|
||||||
@ -91,10 +91,10 @@ static ox::Error runTileSheetSetTest(turbine::Context &tctx) {
|
|||||||
gfx::TileSheetSet const set{
|
gfx::TileSheetSet const set{
|
||||||
.bpp = 4,
|
.bpp = 4,
|
||||||
.entries = {
|
.entries = {
|
||||||
{ .tilesheet = ox::StringLiteral{"/TileSheets/Chester.nts"}, .sections{{.begin = 0, .tiles = 1}} },
|
{ .tilesheet = ox::StringLiteral{"/TileSheets/Chester.ng"}, .sections{{.begin = 0, .tiles = 1}} },
|
||||||
{ .tilesheet = ox::StringLiteral{"/TileSheets/AB.nts"}, .sections{{.begin = 0, .tiles = 2}} },
|
{ .tilesheet = ox::StringLiteral{"/TileSheets/AB.ng"}, .sections{{.begin = 0, .tiles = 2}} },
|
||||||
{ .tilesheet = ox::StringLiteral{"/TileSheets/CD.nts"}, .sections{{.begin = 0, .tiles = 2}} },
|
{ .tilesheet = ox::StringLiteral{"/TileSheets/CD.ng"}, .sections{{.begin = 0, .tiles = 2}} },
|
||||||
{ .tilesheet = ox::StringLiteral{"/TileSheets/AB.nts"}, .sections{{.begin = 1, .tiles = 1}} },
|
{ .tilesheet = ox::StringLiteral{"/TileSheets/AB.ng"}, .sections{{.begin = 1, .tiles = 1}} },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
constexpr auto bgPalBank = 1;
|
constexpr auto bgPalBank = 1;
|
||||||
|
@ -63,11 +63,8 @@ namespace detail {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr auto makeLoader(Context &ctx) {
|
constexpr auto makeLoader(Context &ctx) {
|
||||||
return [&ctx](ox::StringViewCR assetId) -> ox::Result<T> {
|
return [&ctx](ox::StringViewCR assetId) -> ox::Result<T> {
|
||||||
auto const p = ctx.uuidToPath.at(assetId);
|
OX_REQUIRE(p, ctx.uuidToPath.at(assetId));
|
||||||
if (p.error) {
|
OX_REQUIRE(buff, ctx.rom->read(*p));
|
||||||
return ox::Error{1, "Asset ID not found"};
|
|
||||||
}
|
|
||||||
OX_REQUIRE(buff, ctx.rom->read(*p.value));
|
|
||||||
auto [obj, err] = readAsset<T>(buff);
|
auto [obj, err] = readAsset<T>(buff);
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err != ox::Error_ClawTypeVersionMismatch && err != ox::Error_ClawTypeMismatch) {
|
if (err != ox::Error_ClawTypeVersionMismatch && err != ox::Error_ClawTypeMismatch) {
|
||||||
|
@ -76,11 +76,8 @@ ox::Error buildUuidMap(Context &ctx) noexcept {
|
|||||||
|
|
||||||
ox::Result<ox::UUID> pathToUuid(Context &ctx, ox::StringViewCR path) noexcept {
|
ox::Result<ox::UUID> pathToUuid(Context &ctx, ox::StringViewCR path) noexcept {
|
||||||
#ifndef OX_BARE_METAL
|
#ifndef OX_BARE_METAL
|
||||||
auto const out = ctx.pathToUuid.at(path);
|
OX_REQUIRE(out, ctx.pathToUuid.at(path));
|
||||||
if (out.error) {
|
return *out;
|
||||||
return ox::Error{1, "Path not found"};
|
|
||||||
}
|
|
||||||
return *out.value;
|
|
||||||
#else
|
#else
|
||||||
return ox::Error(1, "UUID to path conversion not supported on this platform");
|
return ox::Error(1, "UUID to path conversion not supported on this platform");
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user