[nostalgia/core] Add Fill command to tilesheet editor and make ClipboardObject more efficient

This commit is contained in:
2022-03-11 20:41:36 -06:00
parent ae80d22769
commit 7df978605f
7 changed files with 391 additions and 337 deletions
+20 -1
View File
@@ -17,6 +17,25 @@ class Size;
namespace nostalgia::core {
class BaseClipboardObject {
public:
virtual ~BaseClipboardObject() = default;
virtual ox::String typeId() const noexcept = 0;
constexpr auto typeMatch(auto name, auto version) const noexcept {
auto inId = ox::sfmt("{};{}", name, version);
return typeId() == inId;
}
};
template<typename T>
class ClipboardObject: public BaseClipboardObject {
ox::String typeId() const noexcept final {
return ox::sfmt("{};{}", T::TypeName, T::TypeVersion);
}
};
class Context;
class Drawer;
@@ -59,7 +78,7 @@ class Context {
#ifndef OX_BARE_METAL
AssetManager assetManager;
int uninterruptedRefreshes = 0;
ox::Buffer clipboard;
ox::UniquePtr<BaseClipboardObject> clipboard;
#endif
protected:
#ifndef OX_BARE_METAL