From 4c04fdd72f80fb2227ce6863ba582d6d21f25900 Mon Sep 17 00:00:00 2001 From: Noel Berry Date: Sat, 12 Feb 2022 00:16:11 -0800 Subject: [PATCH] clarified Aseprite state, removed unnecessary copy/move code --- include/blah/images/aseprite.h | 13 +++----- src/images/aseprite.cpp | 56 ---------------------------------- 2 files changed, 4 insertions(+), 65 deletions(-) diff --git a/include/blah/images/aseprite.h b/include/blah/images/aseprite.h index b1fca6d..6eca495 100644 --- a/include/blah/images/aseprite.h +++ b/include/blah/images/aseprite.h @@ -8,8 +8,9 @@ namespace Blah { // A simple Aseprite file parser. - // This implementation does not support Aseprite blendmodes, - // aside from the default blend mode. + // Note: + // - This implementation does not support Aseprite blendmodes. + // - This implementation does not yet support Tilesets. class Aseprite { public: @@ -121,21 +122,15 @@ namespace Blah Modes mode = Modes::RGBA; int width = 0; int height = 0; - Vector layers; Vector frames; Vector tags; Vector slices; Vector palette; - Aseprite(); + Aseprite() = default; Aseprite(const FilePath& path); Aseprite(Stream& stream); - Aseprite(const Aseprite& src); - Aseprite(Aseprite&& src) noexcept; - Aseprite& operator=(const Aseprite& src); - Aseprite& operator=(Aseprite&& src) noexcept; - ~Aseprite(); private: UserData* m_last_userdata = nullptr; diff --git a/src/images/aseprite.cpp b/src/images/aseprite.cpp index 433e743..a3fdd66 100644 --- a/src/images/aseprite.cpp +++ b/src/images/aseprite.cpp @@ -10,9 +10,6 @@ using namespace Blah; -Aseprite::Aseprite() -= default; - Aseprite::Aseprite(const FilePath& path) { FileStream fs(path, FileMode::OpenRead); @@ -24,59 +21,6 @@ Aseprite::Aseprite(Stream& stream) parse(stream); } -Aseprite::Aseprite(const Aseprite& src) -{ - mode = src.mode; - width = src.width; - height = src.height; - layers = src.layers; - frames = src.frames; - tags = src.tags; - slices = src.slices; - palette = src.palette; -} - -Aseprite::Aseprite(Aseprite&& src) noexcept -{ - mode = src.mode; - width = src.width; - height = src.height; - layers = std::move(src.layers); - frames = std::move(src.frames); - tags = std::move(src.tags); - slices = std::move(src.slices); - palette = std::move(src.palette); -} - -Aseprite& Aseprite::operator=(const Aseprite& src) -{ - mode = src.mode; - width = src.width; - height = src.height; - layers = src.layers; - frames = src.frames; - tags = src.tags; - slices = src.slices; - palette = src.palette; - return *this; -} - -Aseprite& Aseprite::operator=(Aseprite&& src) noexcept -{ - mode = src.mode; - width = src.width; - height = src.height; - layers = std::move(src.layers); - frames = std::move(src.frames); - tags = std::move(src.tags); - slices = std::move(src.slices); - palette = std::move(src.palette); - return *this; -} - -Aseprite::~Aseprite() -= default; - void Aseprite::parse(Stream& stream) { if (!stream.is_readable())