summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-04-09 01:37:57 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-04-09 01:37:57 +0200
commit250e0817fedc6e9337debe07bf64a19bd7e0baa8 (patch)
tree84a215affadc135f2bedc70268701bcf6b248b84 /src
parenteea5eafd6a004a2d7242c46646c98701e7fc0af2 (diff)
w
Diffstat (limited to 'src')
-rw-r--r--src/critter.hpp2
-rw-r--r--src/light.hpp4
-rw-r--r--src/scenery.cpp15
-rw-r--r--src/scenery.hpp1
4 files changed, 3 insertions, 19 deletions
diff --git a/src/critter.hpp b/src/critter.hpp
index 7f2d96ae..0ac56578 100644
--- a/src/critter.hpp
+++ b/src/critter.hpp
@@ -14,7 +14,7 @@ struct critter_proto : object_proto
{
String name;
float speed = 1;
- bool playable : 1 = false;
+ bool playable = false;
critter_proto();
critter_proto(const critter_proto&);
diff --git a/src/light.hpp b/src/light.hpp
index ecc45d31..f32edb21 100644
--- a/src/light.hpp
+++ b/src/light.hpp
@@ -17,8 +17,8 @@ struct light_proto : object_proto
float max_distance = 0;
Color4ub color{255, 255, 255, 255};
- light_falloff falloff : 3 = light_falloff::linear;
- uint8_t enabled : 1 = true;
+ light_falloff falloff = light_falloff::linear;
+ bool enabled = true;
};
struct light final : object
diff --git a/src/scenery.cpp b/src/scenery.cpp
index 484a84e9..df9fffba 100644
--- a/src/scenery.cpp
+++ b/src/scenery.cpp
@@ -222,21 +222,6 @@ scenery_variants scenery::subtype_from_proto(object_id id, class chunk& c, const
);
}
-scenery_variants scenery::subtype_from_scenery_type(object_id id, class chunk& c, enum scenery_type type)
-{
- switch (type)
- {
- case scenery_type::none:
- case scenery_type::COUNT:
- break;
- case scenery_type::generic:
- return generic_scenery{id, c, {}};
- case scenery_type::door:
- return door_scenery{id, c, {}};
- }
- fm_throw("invalid scenery type"_cf, (int)type);
-}
-
scenery::scenery(object_id id, class chunk& c, const scenery_proto& proto) :
object{id, c, proto}, subtype{ subtype_from_proto(id, c, proto.subtype) }
{
diff --git a/src/scenery.hpp b/src/scenery.hpp
index c7d2a92a..c7324406 100644
--- a/src/scenery.hpp
+++ b/src/scenery.hpp
@@ -105,7 +105,6 @@ struct scenery final : object
enum scenery_type scenery_type() const;
static scenery_variants subtype_from_proto(object_id id, class chunk& c, const scenery_proto_variants& variants);
- static scenery_variants subtype_from_scenery_type(object_id id, class chunk& c, enum scenery_type type);
private:
friend class world;