diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-29 21:29:56 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-01 06:06:53 +0100 |
commit | 486e591169af724107ffaf6f24cd1e81b24529a9 (patch) | |
tree | 012ec6c07c474d4695eb5c22b47dd35cfce2767c /src/object.hpp | |
parent | 5afe42d6a81eeb81db08d4bd2107ac4c71f6671e (diff) |
time wip
It works now, but some functionality is lost in main/draw.cpp
Diffstat (limited to 'src/object.hpp')
-rw-r--r-- | src/object.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/object.hpp b/src/object.hpp index 2d33885d..e462c8db 100644 --- a/src/object.hpp +++ b/src/object.hpp @@ -6,6 +6,7 @@ #include "src/object-type.hpp" #include "src/object-id.hpp" #include "src/point.hpp" +#include "src/timer-fwd.hpp" #include <memory> namespace floormat { @@ -68,7 +69,7 @@ struct object virtual object_type type() const noexcept = 0; virtual bool can_activate(size_t i) const; virtual bool activate(size_t i); - virtual void update(size_t i, float dt) = 0; + virtual void update(size_t i, Ns dt) = 0; virtual void rotate(size_t i, rotation r); virtual bool can_rotate(global_coords coord, rotation new_r, rotation old_r, Vector2b offset, Vector2b bbox_offset, Vector2ub bbox_size); virtual bool can_move_to(Vector2i delta, global_coords coord, Vector2b offset, Vector2b bbox_offset, Vector2ub bbox_aize); @@ -84,6 +85,9 @@ struct object void move_to(size_t& i, Vector2i delta, rotation new_r); void move_to(Vector2i delta); + static uint32_t allocate_frame_time(Ns dt, uint16_t& accum, uint32_t hz); + uint32_t allocate_frame_time(Ns dt); + protected: object(object_id id, class chunk& c, const object_proto& proto); void set_bbox_(Vector2b offset, Vector2b bbox_offset, Vector2ub bbox_size, pass_mode pass); |