diff options
-rw-r--r-- | main/draw.cpp | 2 | ||||
-rw-r--r-- | src/critter.hpp | 2 | ||||
-rw-r--r-- | src/global-coords.hpp | 1 | ||||
-rw-r--r-- | src/object.cpp | 2 | ||||
-rw-r--r-- | src/object.hpp | 3 | ||||
-rw-r--r-- | src/timer-ns.cpp | 3 | ||||
-rw-r--r-- | test/critter.cpp | 4 |
7 files changed, 7 insertions, 10 deletions
diff --git a/main/draw.cpp b/main/draw.cpp index d2fde66e..10590fce 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -15,7 +15,7 @@ namespace floormat { namespace { -size_t bad_frame_counter = 0; +size_t bad_frame_counter = 0; // NOLINT } // namespace diff --git a/src/critter.hpp b/src/critter.hpp index fc3e8f17..f3d7a316 100644 --- a/src/critter.hpp +++ b/src/critter.hpp @@ -35,7 +35,7 @@ struct critter final : object String name; float speed = 1; - Vector2us offset_frac; + Vector2us offset_frac; // todo! switch to Vector2ui due to `allocate_frame_time' bool b_L : 1 = false, b_R : 1 = false, b_U : 1 = false, b_D : 1 = false; bool playable : 1 = false; diff --git a/src/global-coords.hpp b/src/global-coords.hpp index ef571b18..031b84d7 100644 --- a/src/global-coords.hpp +++ b/src/global-coords.hpp @@ -1,6 +1,5 @@ #pragma once #include "local-coords.hpp" -#include "compat/assert.hpp" #include <Magnum/Magnum.h> #include <Magnum/Math/Vector2.h> #include <Magnum/Math/Vector3.h> diff --git a/src/object.cpp b/src/object.cpp index 82c79d7d..b825974f 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -296,7 +296,6 @@ uint32_t object::allocate_frame_time(Ns dt, uint16_t& accum, uint32_t hz, float fm_assert(hz > 0); fm_assert(dt >= Ns{0}); - //const auto count = Ns::Type{ns_in_sec / hz} + accum}; const auto from_accum = uint64_t{accum} * ns_in_sec / u16_max; const auto from_dt = Ns(uint64_t(ld(dt.stamp) * ld(speed))); fm_assert(from_dt <= Ns{uint64_t{1} << 54}); @@ -308,6 +307,7 @@ uint32_t object::allocate_frame_time(Ns dt, uint16_t& accum, uint32_t hz, float const auto new_accum = (uint16_t)Math::clamp(new_accum_, uint64_t{0}, u16_max); [[maybe_unused]] const auto old_accum = accum; accum = new_accum; + #if 0 DBG_nospace << "alloc-frame-time: " << "dt:" << fraction(Time::to_milliseconds(dt)) << "ms" diff --git a/src/object.hpp b/src/object.hpp index 9f029efa..3976088e 100644 --- a/src/object.hpp +++ b/src/object.hpp @@ -47,7 +47,8 @@ struct object const global_coords coord; const Vector2b offset, bbox_offset; const Vector2ub bbox_size; - uint16_t delta = 0, frame = 0; + uint16_t delta = 0; // todo! switch to Vector2ui due to `allocate_frame_time' + uint16_t frame = 0; const rotation r = rotation::N; // todo remove bitfield? const pass_mode pass = pass_mode::see_through; bool ephemeral : 1 = false; diff --git a/src/timer-ns.cpp b/src/timer-ns.cpp index 5bc302ff..2fd83968 100644 --- a/src/timer-ns.cpp +++ b/src/timer-ns.cpp @@ -8,7 +8,6 @@ namespace floormat { namespace { -#if 0 constexpr auto MAX = (uint64_t)-1, HALF = MAX/2; static_assert(MAX - (MAX-0) <= 0); @@ -22,8 +21,6 @@ static_assert(MAX - HALF <= HALF+1); //static_assert(MAX - (MAX-2) <= 1); // must fail //static_assert(MAX - HALF <= HALF); // must fail -#endif - } // namespace Debug& operator<<(Debug& dbg, const Ns& box) diff --git a/test/critter.cpp b/test/critter.cpp index f8f75485..0a959317 100644 --- a/test/critter.cpp +++ b/test/critter.cpp @@ -56,10 +56,10 @@ void run(StringView name, const F& make_dt, critter& npc, const Ns max_time, last_pos = pos; Debug{} << "-" << pos << colon(',') << time; - if (time > max_time) + if (time > max_time) [[unlikely]] { if (verbose) - Debug{&std::cerr} << "timeout:" << max_time << "reached!"; + Error{&std::cerr} << "timeout:" << max_time << "reached!"; fm_EMIT_ABORT(); } |