summaryrefslogtreecommitdiffhomepage
path: root/src/tile-image.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-01 14:41:50 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-01 14:41:50 +0100
commit60eea789335743855f380249b8bbaf544fea3887 (patch)
treec7ca89db9b7abc21b41c9c4177828a5f2b0568a6 /src/tile-image.cpp
parente38dfcc15401b48b5424834ba730d1d229ed9c6a (diff)
WIP
Diffstat (limited to 'src/tile-image.cpp')
-rw-r--r--src/tile-image.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/tile-image.cpp b/src/tile-image.cpp
index 784bd4f5..c9dc24f4 100644
--- a/src/tile-image.cpp
+++ b/src/tile-image.cpp
@@ -2,10 +2,33 @@
namespace floormat {
-bool operator==(const tile_image& a, const tile_image& b) noexcept
+bool operator==(const tile_image_proto& a, const tile_image_proto& b) noexcept = default;
+
+tile_image_ref::tile_image_ref(std::shared_ptr<tile_atlas>& atlas, std::uint16_t& variant) noexcept :
+ atlas{atlas}, variant{variant}
{
- return a.atlas == b.atlas && a.variant == b.variant;
}
-} // namespace floormat
+tile_image_ref& tile_image_ref::operator=(tile_image_ref&& ref) noexcept
+{
+ atlas = ref.atlas;
+ variant = ref.variant;
+ return *this;
+}
+
+tile_image_ref& tile_image_ref::operator=(const tile_image_proto& proto) noexcept
+{
+ atlas = proto.atlas;
+ variant = proto.variant;
+ return *this;
+}
+
+tile_image_ref::tile_image_ref(const tile_image_ref&) noexcept = default;
+tile_image_ref::tile_image_ref(tile_image_ref&&) noexcept = default;
+
+tile_image_ref::operator tile_image_proto() const noexcept
+{
+ return { atlas, variant };
+}
+} // namespace floormat