summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--editor/update.cpp2
-rw-r--r--src/scenery.hpp10
2 files changed, 5 insertions, 7 deletions
diff --git a/editor/update.cpp b/editor/update.cpp
index e9207cf6..cc765268 100644
--- a/editor/update.cpp
+++ b/editor/update.cpp
@@ -29,7 +29,7 @@ void app::maybe_initialize_chunk_(const chunk_coords& pos, chunk& c)
c[{K, K }].wall_west() = { _wall2, 0 };
c[{K, K+1}].wall_north() = { _wall1, 0 };
c[{K+1, K }].wall_west() = { _wall2, 0 };
- c[{K+1, K+1}].scenery() = { _door, scenery{rotation::N, 0} };
+ c[{K+1, K+1}].scenery() = { _door, scenery{0, rotation::N} };
c.mark_modified();
}
diff --git a/src/scenery.hpp b/src/scenery.hpp
index 3e7c4e4f..cc8cc159 100644
--- a/src/scenery.hpp
+++ b/src/scenery.hpp
@@ -6,23 +6,21 @@ namespace floormat {
struct anim_atlas;
-enum class rotation : std::uint16_t {
+enum class rotation : std::uint8_t {
N, NE, E, SE, S, SW, W, NW,
COUNT,
};
struct scenery final
{
- static constexpr auto NO_FRAME = (1 << 12) - 1;
+ static constexpr auto NO_FRAME = (std::uint16_t)-1;
using frame_t = std::uint16_t;
- rotation r : 4 = rotation::N;
- frame_t frame : 12 = NO_FRAME;
+ frame_t frame = NO_FRAME;
+ rotation r = rotation::N;
};
-static_assert(sizeof(scenery) == sizeof(std::uint16_t));
-
struct scenery_proto final {
std::shared_ptr<anim_atlas> atlas;
scenery frame;