diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-17 07:12:49 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-17 23:23:11 +0100 |
commit | d0efe8b98e2941028304d3f419197002e4ad2811 (patch) | |
tree | 2dbb810c0e4548c1debdcc832e92a0473d9227a0 /src | |
parent | 721503fb783beb2c6a11c5f9aa589ef210cb8699 (diff) |
bbb
Diffstat (limited to 'src')
-rw-r--r-- | src/anim.hpp | 2 | ||||
-rw-r--r-- | src/chunk.hpp | 4 | ||||
-rw-r--r-- | src/entity-type.hpp | 3 | ||||
-rw-r--r-- | src/entity.hpp | 6 | ||||
-rw-r--r-- | src/pass-mode.hpp | 7 | ||||
-rw-r--r-- | src/scenery.hpp | 14 |
6 files changed, 17 insertions, 19 deletions
diff --git a/src/anim.hpp b/src/anim.hpp index f21e24ae..8d5e6d27 100644 --- a/src/anim.hpp +++ b/src/anim.hpp @@ -28,7 +28,7 @@ struct anim_group final Vector3b offset; }; -enum class anim_scale_type : std::uint8_t { invalid, ratio, fixed, }; +enum class anim_scale_type : unsigned char { invalid, ratio, fixed, }; struct anim_scale final { diff --git a/src/chunk.hpp b/src/chunk.hpp index d5070f02..0cd7bcfc 100644 --- a/src/chunk.hpp +++ b/src/chunk.hpp @@ -13,11 +13,11 @@ struct anim_atlas; struct entity; struct entity_proto; -enum class collision : std::uint8_t { +enum class collision : unsigned char { view, shoot, move, }; -enum class collision_type : std::uint8_t { +enum class collision_type : unsigned char { none, entity, scenery, geometry, }; diff --git a/src/entity-type.hpp b/src/entity-type.hpp index 079cec77..625b53c0 100644 --- a/src/entity-type.hpp +++ b/src/entity-type.hpp @@ -1,9 +1,8 @@ #pragma once -#include <cstdint> namespace floormat { -enum class entity_type : std::uint8_t { +enum class entity_type : unsigned char { none, character, scenery, }; diff --git a/src/entity.hpp b/src/entity.hpp index da6ccca3..396cb881 100644 --- a/src/entity.hpp +++ b/src/entity.hpp @@ -20,9 +20,9 @@ struct entity_proto Vector2b offset, bbox_offset; Vector2ub bbox_size = Vector2ub(iTILE_SIZE2); std::uint16_t delta = 0, frame = 0; - entity_type type = entity_type::none; - rotation r : rotation_BITS = rotation::N; - pass_mode pass : pass_mode_BITS = pass_mode::see_through; + entity_type type : 3 = entity_type::none; + rotation r : rotation_BITS = rotation::N; + pass_mode pass : pass_mode_BITS = pass_mode::see_through; float ordinal(local_coords coord) const; entity_proto& operator=(const entity_proto&); diff --git a/src/pass-mode.hpp b/src/pass-mode.hpp index accefaae..876466d7 100644 --- a/src/pass-mode.hpp +++ b/src/pass-mode.hpp @@ -1,10 +1,9 @@ #pragma once -#include <cstdint> namespace floormat { -enum class pass_mode : std::uint8_t { blocked, see_through, shoot_through, pass, }; -constexpr inline std::uint8_t pass_mode_COUNT = 4; -constexpr inline std::uint8_t pass_mode_BITS = 2; +enum class pass_mode : unsigned char { blocked, see_through, shoot_through, pass, }; +constexpr inline unsigned char pass_mode_COUNT = 4; +constexpr inline unsigned char pass_mode_BITS = 2; } // namespace floormat diff --git a/src/scenery.hpp b/src/scenery.hpp index 68ba1607..61024b55 100644 --- a/src/scenery.hpp +++ b/src/scenery.hpp @@ -15,16 +15,16 @@ struct chunk; struct anim_atlas; struct world; -enum class scenery_type : std::uint8_t { +enum class scenery_type : unsigned char { none, generic, door, }; struct scenery_proto : entity_proto { scenery_type sc_type : 3 = scenery_type::none; - std::uint8_t active : 1 = false; - std::uint8_t closing : 1 = false; - std::uint8_t interactive : 1 = false; + unsigned char active : 1 = false; + unsigned char closing : 1 = false; + unsigned char interactive : 1 = false; scenery_proto(); scenery_proto(const scenery_proto&); @@ -37,9 +37,9 @@ struct scenery_proto : entity_proto struct scenery final : entity { scenery_type sc_type : 3 = scenery_type::none; - std::uint8_t active : 1 = false; - std::uint8_t closing : 1 = false; - std::uint8_t interactive : 1 = false; + unsigned char active : 1 = false; + unsigned char closing : 1 = false; + unsigned char interactive : 1 = false; bool can_activate(std::size_t i) const override; bool activate(std::size_t i) override; |