diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-22 00:52:56 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-22 00:54:27 +0100 |
commit | c91cc537121ce7d1c4722b5c9ea88f7e7301fa15 (patch) | |
tree | 241cf08f19762520f4f66a52e720fddbd2c1345e /src | |
parent | 7eb5e07707e62154a8aa5412ddb1da69e2a316e4 (diff) |
aaaa
Diffstat (limited to 'src')
-rw-r--r-- | src/wall-atlas.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/wall-atlas.cpp b/src/wall-atlas.cpp index 31b2ad2d..d63d0ec0 100644 --- a/src/wall-atlas.cpp +++ b/src/wall-atlas.cpp @@ -180,9 +180,31 @@ bool Direction::is_empty() const noexcept } bool Frame::operator==(const Frame&) const noexcept = default; -bool Group::operator==(const Group&) const noexcept = default; bool Direction::operator==(const Direction&) const noexcept = default; bool Info::operator==(const floormat::Wall::Info&) const noexcept = default; bool DirArrayIndex::operator==(const floormat::Wall::DirArrayIndex&) const noexcept = default; +#if 1 +bool Group::operator==(const Group&) const noexcept = default; +#else +bool Group::operator==(const Group& other) const noexcept +{ + bool ret = index == other.index && count == other.count && + pixel_size == other.pixel_size && + from_rotation == other.from_rotation && + mirrored == other.mirrored && default_tint == other.default_tint; + + if (!ret) + return ret; + + constexpr auto eps = 1e-5f; + if (auto diff = Math::abs(Vector4(tint_mult) - Vector4(other.tint_mult)).sum(); diff > eps) + return false; + if (auto diff = Math::abs(Vector3(tint_add) - Vector3(other.tint_add)).sum(); diff > eps) + return false; + + return true; +} +#endif + } // namespace floormat::Wall |