diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-27 21:04:41 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-27 21:06:57 +0100 |
commit | b7f3cff0904214f7161fed16bb5162b26260d386 (patch) | |
tree | b44ed9506e6fb1782987667ef92ebab9af1b8579 /src | |
parent | 11eb5a82f0cdddd79f051192110f9f3f4da7d58c (diff) |
add speed field to object (yet unused)
Diffstat (limited to 'src')
-rw-r--r-- | src/critter.hpp | 1 | ||||
-rw-r--r-- | src/object.cpp | 2 | ||||
-rw-r--r-- | src/object.hpp | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/src/critter.hpp b/src/critter.hpp index 00e01cd1..b2f356e4 100644 --- a/src/critter.hpp +++ b/src/critter.hpp @@ -1,6 +1,5 @@ #pragma once #include "src/global-coords.hpp" -#include "src/rotation.hpp" #include "src/object.hpp" #include <Corrade/Containers/String.h> diff --git a/src/object.cpp b/src/object.cpp index 307a2155..96acd4b9 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -47,7 +47,7 @@ object_proto::object_proto(const object_proto&) = default; object_type object_proto::type_of() const noexcept { return type; } object::object(object_id id, class chunk& c, const object_proto& proto) : - id{id}, c{&c}, atlas{proto.atlas}, + id{id}, c{&c}, atlas{proto.atlas}, speed{proto.speed}, offset{proto.offset}, bbox_offset{proto.bbox_offset}, bbox_size{proto.bbox_size}, delta{proto.delta}, frame{proto.frame}, r{proto.r}, pass{proto.pass} diff --git a/src/object.hpp b/src/object.hpp index 2d33885d..c915b134 100644 --- a/src/object.hpp +++ b/src/object.hpp @@ -18,6 +18,7 @@ class chunk; struct object_proto { std::shared_ptr<anim_atlas> atlas; + float speed = 1; Vector2b offset, bbox_offset; Vector2ub bbox_size = Vector2ub(tile_size_xy); uint16_t delta = 0, frame = 0; @@ -44,6 +45,7 @@ struct object class chunk* const c; const std::shared_ptr<anim_atlas> atlas; const global_coords coord; + float speed = 1; const Vector2b offset, bbox_offset; const Vector2ub bbox_size; uint16_t delta = 0, frame = 0; |