diff --git a/deps/ox/src/ox/std/stringliteral.hpp b/deps/ox/src/ox/std/stringliteral.hpp index f78b946..adf4127 100644 --- a/deps/ox/src/ox/std/stringliteral.hpp +++ b/deps/ox/src/ox/std/stringliteral.hpp @@ -19,7 +19,7 @@ namespace ox { */ class StringLiteral: public detail::BaseStringView { public: - consteval StringLiteral() noexcept = default; + constexpr StringLiteral() noexcept = default; constexpr StringLiteral(StringLiteral const &sv) noexcept = default; diff --git a/release-notes.md b/release-notes.md index 43a2a13..41b4281 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,3 +1,9 @@ +# d2025.07.0 + +* Add sub-command for exporting TileSheets as PNG files. +* Add 'Reload Project' menu item under File. +* Fix opening a project to mark an unopenable file as closed in the config file on startup. + # d2025.06.0 * Add ability to remember recent projects in config diff --git a/src/nostalgia/modules/gfx/include/nostalgia/gfx/consts.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/consts.hpp index 887c7cc..1b4bfe0 100644 --- a/src/nostalgia/modules/gfx/include/nostalgia/gfx/consts.hpp +++ b/src/nostalgia/modules/gfx/include/nostalgia/gfx/consts.hpp @@ -21,9 +21,28 @@ constexpr ox::Array FileExts_TileSheet{ FileExt_ng, }; +constexpr ox::Array FileExts_Palette{ + FileExt_npal, +}; + [[nodiscard]] constexpr bool isTileSheet(ox::StringViewCR path) noexcept { - return endsWith(path, FileExt_nts) || endsWith(path, FileExt_ng); + return ox::any_of( + FileExts_TileSheet.begin(), + FileExts_TileSheet.end(), + [path](ox::StringLiteral const &ext) { + return endsWith(path, ext); + }); +} + +[[nodiscard]] +constexpr bool isPalette(ox::StringViewCR path) noexcept { + return ox::any_of( + FileExts_Palette.begin(), + FileExts_Palette.end(), + [path](ox::StringLiteral const &ext) { + return endsWith(path, ext); + }); } } diff --git a/src/olympic/keel/include/keel/assetmanager.hpp b/src/olympic/keel/include/keel/assetmanager.hpp index 62cda92..2719e45 100644 --- a/src/olympic/keel/include/keel/assetmanager.hpp +++ b/src/olympic/keel/include/keel/assetmanager.hpp @@ -64,11 +64,13 @@ class AssetContainer { protected: constexpr void incRefs() const noexcept { + oxAssert(m_references < ox::MaxValue, "reference count exceeds maximum"); ++m_references; } constexpr void decRefs() const noexcept { --m_references; + oxAssert(m_references >= 0, "negative references"); } [[nodiscard]] @@ -162,6 +164,7 @@ template constexpr AssetRef::AssetRef(AssetContainer const*c) noexcept: m_ctr(c) { if (m_ctr) { m_ctr->updated.connect(this, &AssetRef::emitUpdated); + m_ctr->incRefs(); } }