Squashed 'deps/nostalgia/' changes from ab025e88..4d63a65f

4d63a65f [nostalgia/core/studio] Show Palette page names in TileSheetEditor
686db99d [nostalgia/core/studio] Disable Palette page hotkeys when Rename popup is open
52533c8c [nostalgia/core/studio] Add Palette page names to editor
ba4540e4 [ox/std] Add IString::unsafeResize
36057bb0 [nostalgia/core/studio] Fix Clang build
1a2b2b8b [nostalgia/core] Add PaletteV4, with support for page names, make PaletteColor object
6189193a [nostalgia] Add NFDE install
67a10d35 [nostalgia/sample_project] Update type descriptor

git-subtree-dir: deps/nostalgia
git-subtree-split: 4d63a65fbde480235edd961e5cd19d8b4de1b66d
This commit is contained in:
2024-09-07 00:16:03 -05:00
parent a1a34f27f9
commit ca2d9eb534
23 changed files with 459 additions and 120 deletions

View File

@ -81,6 +81,11 @@ class IString {
constexpr ox::Error resize(size_t sz) noexcept;
/**
* Resizes without clearing memory between current end and new end.
*/
constexpr ox::Error unsafeResize(size_t sz) noexcept;
/**
* Returns the capacity of bytes for this string.
*/
@ -220,6 +225,15 @@ constexpr ox::Error IString<StrCap>::resize(size_t sz) noexcept {
return {};
}
template<std::size_t StrCap>
constexpr ox::Error IString<StrCap>::unsafeResize(size_t sz) noexcept {
if (sz > StrCap) [[unlikely]] {
return OxError(1, "Trying to extend IString beyond its cap");
}
m_size = sz;
return {};
}
template<size_t sz>
struct MaybeView<ox::IString<sz>> {
using type = ox::StringView;