diff --git a/src/nostalgia/modules/core/include/nostalgia/core/palette.hpp b/src/nostalgia/modules/core/include/nostalgia/core/palette.hpp index 04523c56..af61225f 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/palette.hpp +++ b/src/nostalgia/modules/core/include/nostalgia/core/palette.hpp @@ -75,15 +75,12 @@ constexpr bool valid(Palette const&p) noexcept { } [[nodiscard]] -constexpr bool repair(Palette &p) noexcept { +constexpr ox::Error repair(Palette &p) noexcept { auto const colors = p.colorInfo.size(); - if (p.pages.size() == 0) { - p.pages.emplace_back(); - } for (auto &page : p.pages) { page.resize(colors); } - return true; + return {}; } [[nodiscard]] diff --git a/src/olympic/keel/include/keel/assetmanager.hpp b/src/olympic/keel/include/keel/assetmanager.hpp index 301bde1c..b17d2cf1 100644 --- a/src/olympic/keel/include/keel/assetmanager.hpp +++ b/src/olympic/keel/include/keel/assetmanager.hpp @@ -28,8 +28,8 @@ constexpr bool valid(auto const&) noexcept { } [[nodiscard]] -constexpr bool repair(auto const&) noexcept { - return false; +constexpr ox::Error repair(auto const&) noexcept { + return {}; } #ifndef OX_BARE_METAL @@ -226,7 +226,7 @@ class AssetManager { ox::Result> loadAsset(ox::StringView const assetId) noexcept { auto &p = m_cache[assetId]; oxRequireM(obj, m_loader(assetId)); - if (!valid(obj) && !repair(obj)) { + if (!valid(obj) && repair(obj)) { return OxError(1, "asset is invalid state and could not be repaired"); } if (!p) {