diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-23 15:33:38 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-23 15:34:12 +0100 |
commit | eb4922fc429764504a7e94e8c712c368c51685f2 (patch) | |
tree | dc2338c69f7811c46c8820846d62dca61271e7a7 /src | |
parent | 62effff4a9bb2cddd515f6d6123c7ed141258ac1 (diff) |
scenery: add table
Diffstat (limited to 'src')
-rw-r--r-- | src/anim-atlas.cpp | 4 | ||||
-rw-r--r-- | src/anim-atlas.hpp | 2 | ||||
-rw-r--r-- | src/scenery.cpp | 8 | ||||
-rw-r--r-- | src/scenery.hpp | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/anim-atlas.cpp b/src/anim-atlas.cpp index 841c66d8..33b107df 100644 --- a/src/anim-atlas.cpp +++ b/src/anim-atlas.cpp @@ -33,7 +33,7 @@ decltype(anim_atlas::_group_indices) anim_atlas::make_group_indices(const anim_d anim_atlas::anim_atlas() noexcept = default; anim_atlas::anim_atlas(StringView name, const ImageView2D& image, anim_def info) noexcept : - _name{name}, _bitmask{make_bit_array(image)}, + _name{name}, _bitmask{ make_bitmask(image)}, _info{std::move(info)}, _group_indices{make_group_indices(_info)} { const Size<3>& size = image.pixels().size(); @@ -104,7 +104,7 @@ auto anim_atlas::frame_quad(const Vector3& center, rotation r, std::size_t i) co }}; } -BitArray anim_atlas::make_bit_array(const ImageView2D& tex) +BitArray anim_atlas::make_bitmask(const ImageView2D& tex) { const auto pixels = tex.pixels(); const auto size = pixels.size(); diff --git a/src/anim-atlas.hpp b/src/anim-atlas.hpp index ce0e6176..5b79ca19 100644 --- a/src/anim-atlas.hpp +++ b/src/anim-atlas.hpp @@ -48,7 +48,7 @@ private: static decltype(_group_indices) make_group_indices(const anim_def& anim) noexcept; static std::uint8_t rotation_to_index(const anim_def& a, rotation r) noexcept; - static BitArray make_bit_array(const ImageView2D& tex); + static BitArray make_bitmask(const ImageView2D& tex); }; } // namespace floormat diff --git a/src/scenery.cpp b/src/scenery.cpp index 86561a13..4eed262f 100644 --- a/src/scenery.cpp +++ b/src/scenery.cpp @@ -11,8 +11,8 @@ scenery_proto::scenery_proto(const std::shared_ptr<anim_atlas>& atlas, const sce atlas{atlas}, frame{frame} {} -scenery_proto::scenery_proto(scenery::generic_tag_t, rotation r, const std::shared_ptr<anim_atlas>& atlas, scenery::frame_t frame) : - atlas{atlas}, frame{scenery::generic, r, *atlas, frame} +scenery_proto::scenery_proto(scenery::generic_tag_t, rotation r, const std::shared_ptr<anim_atlas>& atlas, bool passable, scenery::frame_t frame) : + atlas{atlas}, frame{scenery::generic, r, *atlas, passable, frame} {} scenery_proto::scenery_proto(scenery::door_tag_t, rotation r, const std::shared_ptr<anim_atlas>& atlas, bool is_open) : @@ -39,8 +39,8 @@ scenery_ref::operator bool() const noexcept { return atlas != nullptr; } scenery::scenery() noexcept : scenery{none_tag_t{}} {} scenery::scenery(none_tag_t) noexcept : passable{true} {} -scenery::scenery(generic_tag_t, rotation r, const anim_atlas& atlas, frame_t frame) : - frame{frame}, r{r}, type{scenery_type::generic} +scenery::scenery(generic_tag_t, rotation r, const anim_atlas& atlas, bool passable, frame_t frame) : + frame{frame}, r{r}, passable{passable}, type{scenery_type::generic} { fm_assert(frame < atlas.group(r).frames.size()); } diff --git a/src/scenery.hpp b/src/scenery.hpp index 68bb084a..b6468ebe 100644 --- a/src/scenery.hpp +++ b/src/scenery.hpp @@ -39,7 +39,7 @@ struct scenery final scenery() noexcept; scenery(none_tag_t) noexcept; - scenery(generic_tag_t, rotation r, const anim_atlas& atlas, frame_t frame = 0); + scenery(generic_tag_t, rotation r, const anim_atlas& atlas, bool passable = false, frame_t frame = 0); scenery(door_tag_t, rotation r, const anim_atlas& atlas, bool is_open = false); scenery(float dt, frame_t frame, rotation r, bool passable, scenery_type type); @@ -54,7 +54,7 @@ struct scenery_proto final { scenery_proto() noexcept; explicit scenery_proto(scenery::none_tag_t) noexcept; scenery_proto(const std::shared_ptr<anim_atlas>& atlas, const scenery& frame); - scenery_proto(scenery::generic_tag_t, rotation r, const std::shared_ptr<anim_atlas>& atlas, scenery::frame_t frame = 0); + scenery_proto(scenery::generic_tag_t, rotation r, const std::shared_ptr<anim_atlas>& atlas, bool passable = false, scenery::frame_t frame = 0); scenery_proto(scenery::door_tag_t, rotation r, const std::shared_ptr<anim_atlas>& atlas, bool is_open = false); scenery_proto& operator=(const scenery_proto&) noexcept; |