summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-20 21:09:03 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-20 21:09:03 +0100
commit3ed15b56aded3a6f58ef98d0cbe17012e28e9430 (patch)
treee6fa61a797a81fd6bf7ee3f16c4bcb1a5f0bc8ff /src
parent2b710e55157b83cff93e3414e4017b34b9789bc3 (diff)
scenery: don't bother with bitfields
The `scenery_proto` struct is rounded up to a multiple of 8 bytes.
Diffstat (limited to 'src')
-rw-r--r--src/scenery.hpp10
1 files changed, 4 insertions, 6 deletions
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;