Squashed 'deps/nostalgia/' changes from a3d6a58c..d68e6493
d68e6493 [nostalgia/core/studio/tilesheeteditor] Add support for dragging palette to palette selector 1cbc5762 [studio] Complete drag/drop support for files 500b9356 [studio] Make new dir window OK on Enter key 800ca851 [ox/std] Fix possible error that occurs with appending on boundary of small string size cc466a9f [studio] Add support for adding and deleting directories 9d115584 [nostalgia] Rename player from 'nostalgia' to 'Nostalgia' a2139c09 [studio] Cleanup unused member a3e5f27a [ox/std] Fix Mac build 643f95ec [studio] Add confirmation dialog for file deletion, move deletion to Project 69241476 [studio] Add ability to add file through dir context menu 6e2b4fa7 [nostalgia] Cleanup player run in Makefile 4e5c7499 [studio] Add support for deleting files 66229de7 [ox/fs] FileSystem fixes with removing files 7eb37c53 [nostalgia/core/studio/paletteeditor] Fix adding page if there is no existing page 7a21b207 [nostalgia/core] Replace ContextDeleter with safeDelete(Context*) 894be237 [ox/std] Drop ox:: qualifier from safeDelete function for pointee 92e9d9cb [keel,studio] Add support for New Item templates b29b9a9b [ox/std] Add UAnyPtr 721f8442 [nostalgia/core/studio/tilesheeteditor] Fix subsheet and palette scrolling git-subtree-dir: deps/nostalgia git-subtree-split: d68e64931b37d7d8bbaff7b43bf131c7acf2aa97
This commit is contained in:
@@ -20,6 +20,8 @@ class Wrap {
|
||||
virtual ox::CStringView typeName() const noexcept = 0;
|
||||
[[nodiscard]]
|
||||
virtual int typeVersion() const noexcept = 0;
|
||||
[[nodiscard]]
|
||||
virtual ox::UAnyPtr moveToCopy() noexcept = 0;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
@@ -27,6 +29,11 @@ class WrapT: public Wrap {
|
||||
public:
|
||||
[[nodiscard]]
|
||||
virtual constexpr T &obj() noexcept = 0;
|
||||
|
||||
ox::UAnyPtr moveToCopy() noexcept final {
|
||||
return new T{std::move(obj())};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
@@ -184,7 +191,18 @@ ox::Result<ox::UPtr<Wrap>> convert(
|
||||
auto &src,
|
||||
ox::StringViewCR dstTypeName,
|
||||
int const dstTypeVersion) noexcept {
|
||||
return convert(ctx, WrapRef{src}, dstTypeName, dstTypeVersion);
|
||||
WrapRef ref{src};
|
||||
return convert(ctx, static_cast<Wrap&>(ref), dstTypeName, dstTypeVersion);
|
||||
}
|
||||
|
||||
ox::Result<ox::UPtr<Wrap>> convert(
|
||||
keel::Context &ctx,
|
||||
auto const&src,
|
||||
ox::StringViewCR dstTypeName,
|
||||
int const dstTypeVersion) noexcept {
|
||||
auto srcCpy = src;
|
||||
WrapRef ref{srcCpy};
|
||||
return convert(ctx, ref, dstTypeName, dstTypeVersion);
|
||||
}
|
||||
|
||||
template<typename DstType>
|
||||
|
Reference in New Issue
Block a user