Squashed 'deps/nostalgia/' changes from 1cc1d561..ff666eda

ff666eda [studio] Make NewMenu default Name field to focus when it appears
0d8b82ba [studio] Cleanup
5598dfdd [nostalgia/player] Update hardcoded tilesheet refs to new file ext
6ef462ad [keel] Add clearer Error handling
9511cb57 [studio] Fix prev tracking

git-subtree-dir: deps/nostalgia
git-subtree-split: ff666eda9b20181135e163b0553a70101c196589
This commit is contained in:
2025-01-23 21:20:06 -06:00
parent 3fddeeee3e
commit dff9f81e07
9 changed files with 37 additions and 55 deletions

View File

@@ -63,8 +63,11 @@ namespace detail {
template<typename T>
constexpr auto makeLoader(Context &ctx) {
return [&ctx](ox::StringViewCR assetId) -> ox::Result<T> {
OX_REQUIRE(p, ctx.uuidToPath.at(assetId));
OX_REQUIRE(buff, ctx.rom->read(*p));
auto const p = ctx.uuidToPath.at(assetId);
if (p.error) {
return ox::Error{1, "Asset ID not found"};
}
OX_REQUIRE(buff, ctx.rom->read(*p.value));
auto [obj, err] = readAsset<T>(buff);
if (err) {
if (err != ox::Error_ClawTypeVersionMismatch && err != ox::Error_ClawTypeMismatch) {

View File

@@ -76,8 +76,11 @@ ox::Error buildUuidMap(Context &ctx) noexcept {
ox::Result<ox::UUID> pathToUuid(Context &ctx, ox::StringViewCR path) noexcept {
#ifndef OX_BARE_METAL
OX_REQUIRE(out, ctx.pathToUuid.at(path));
return *out;
auto const out = ctx.pathToUuid.at(path);
if (out.error) {
return ox::Error{1, "Path not found"};
}
return *out.value;
#else
return ox::Error(1, "UUID to path conversion not supported on this platform");
#endif