diff options
author | Max-001 <maxsmits21@kpnmail.nl> | 2025-01-08 15:18:16 +0100 |
---|---|---|
committer | Max-001 <maxsmits21@kpnmail.nl> | 2025-01-08 15:18:16 +0100 |
commit | 17b381e96b5a015dd4612d09ca000fb61d46bce7 (patch) | |
tree | 1b336a21280dda04bad2c24c238394acad0c2804 /src/crepe/api/Sprite.cpp | |
parent | 05ce2c58165dc1566c32c6a661d70bad51e3fe15 (diff) | |
parent | 0b9574bdd6c5968c07bcf165d66032b75649b5da (diff) |
Merge remote-tracking branch 'origin/master' into max/game2
Diffstat (limited to 'src/crepe/api/Sprite.cpp')
-rw-r--r-- | src/crepe/api/Sprite.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/crepe/api/Sprite.cpp b/src/crepe/api/Sprite.cpp index 0107c7b..3c77e2e 100644 --- a/src/crepe/api/Sprite.cpp +++ b/src/crepe/api/Sprite.cpp @@ -19,3 +19,16 @@ Sprite::Sprite(game_object_id_t id, const Asset & texture, const Sprite::Data & } Sprite::~Sprite() { dbg_trace(); } + +unique_ptr<Component> Sprite::save() const { return unique_ptr<Component>(new Sprite(*this)); } + +void Sprite::restore(const Component & snapshot) { + *this = static_cast<const Sprite &>(snapshot); +} + +Sprite & Sprite::operator=(const Sprite & snapshot) { + this->active = snapshot.active; + this->data = snapshot.data; + this->mask = snapshot.mask; + return *this; +} |