diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-26 15:36:07 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-26 15:36:07 +0200 |
commit | 3981b5f5e0f191961f01699fab7c50533c48d352 (patch) | |
tree | 976e45d3bc809d2165078f0076b0829aa943201a /src | |
parent | 82ab34aa83463179339eb8382edf1c22cacdad61 (diff) |
fix/remove obsolete todo comments
Diffstat (limited to 'src')
-rw-r--r-- | src/chunk-scenery.cpp | 2 | ||||
-rw-r--r-- | src/critter-script.hpp | 3 | ||||
-rw-r--r-- | src/critter.cpp | 22 | ||||
-rw-r--r-- | src/critter.hpp | 2 | ||||
-rw-r--r-- | src/rotation.hpp | 2 | ||||
-rw-r--r-- | src/scenery-proto.hpp | 2 | ||||
-rw-r--r-- | src/world.hpp | 2 |
7 files changed, 16 insertions, 19 deletions
diff --git a/src/chunk-scenery.cpp b/src/chunk-scenery.cpp index 016c7269..2e491d4d 100644 --- a/src/chunk-scenery.cpp +++ b/src/chunk-scenery.cpp @@ -194,7 +194,7 @@ auto chunk::ensure_scenery_mesh(scenery_scratch_buffers buffers) noexcept -> sce auto index = e->is_dynamic() ? (uint32_t)-1 : j++; array[i++] = { e.get(), (uint32_t)-1, e->ordinal(), make_topo_sort_data(*e, index) }; } - topological_sort(array, i); // todo! do this before upload so that multi-draw works + topological_sort(array, i); return { scenery_mesh, ArrayView<object_draw_order>{array, size}, j }; } diff --git a/src/critter-script.hpp b/src/critter-script.hpp index c26d57e0..2b81a939 100644 --- a/src/critter-script.hpp +++ b/src/critter-script.hpp @@ -17,13 +17,10 @@ struct critter_script : base_script ~critter_script() noexcept override; virtual void on_init(const std::shared_ptr<critter>& c) = 0; - // todo can_activate, activate virtual void on_update(const std::shared_ptr<critter>& c, size_t& i, const Ns& dt) = 0; virtual void on_destroy(const std::shared_ptr<critter>& c, script_destroy_reason reason) = 0; virtual void delete_self() = 0; - // todo! move to src/scripts dir - object_type type() const override; static Pointer<critter_script> make_walk_script(point to); diff --git a/src/critter.cpp b/src/critter.cpp index 505bbe16..4c04022c 100644 --- a/src/critter.cpp +++ b/src/critter.cpp @@ -117,10 +117,10 @@ CORRADE_ALWAYS_INLINE bool update_movement_body(size_t& i, critter& C, const anim_def& info, uint8_t nsteps) { constexpr auto vec = rotation_to_vec(new_r); - using Frac = decltype(critter::offset_frac_); + using Frac = decltype(critter::offset_frac); constexpr auto frac = (float{limits<Frac>::max}+1)/2; constexpr auto inv_frac = 1 / frac; - const auto from_accum = C.offset_frac_ * inv_frac * vec; + const auto from_accum = C.offset_frac * inv_frac * vec; Vector2 offset_{NoInit}; if constexpr(MultiStep) @@ -132,7 +132,7 @@ bool update_movement_body(size_t& i, critter& C, const anim_def& info, uint8_t n if (!off_i.isZero()) { auto rem = Math::fmod(offset_, 1.f).length(); - C.offset_frac_ = Frac(rem * frac); + C.offset_frac = Frac(rem * frac); if (C.can_move_to(off_i)) { C.move_to(i, off_i, new_r); @@ -146,7 +146,7 @@ bool update_movement_body(size_t& i, critter& C, const anim_def& info, uint8_t n else { auto rem = offset_.length(); - C.offset_frac_ = Frac(rem * frac); + C.offset_frac = Frac(rem * frac); return true; } return false; @@ -387,7 +387,7 @@ void critter::update(const std::shared_ptr<object>& ptrʹ, size_t& i, const Ns& const auto new_r = arrows_to_dir(moves.L, moves.R, moves.U, moves.D); if (new_r == rotation_COUNT) { - offset_frac_ = {}; + offset_frac = {}; delta = 0; } else @@ -428,7 +428,7 @@ void critter::update_movement(size_t& i, const Ns& dt, rotation new_r) if (!ret) [[unlikely]] { delta = {}; - offset_frac_ = {}; + offset_frac = {}; } } @@ -466,12 +466,12 @@ auto critter::move_toward(size_t& index, Ns& dt, const point& dest) -> move_resu //Debug{} << "step" << step.direction << step.count << "|" << C.position(); fm_assert(step.direction != Vector2b{} && step.count > 0); const auto new_r = dir_from_step(step); - using Frac = decltype(critter::offset_frac_); + using Frac = decltype(critter::offset_frac); constexpr auto frac = (float{limits<Frac>::max}+1)/2; constexpr auto inv_frac = 1 / frac; const auto mag = step_magnitude(step.direction); const auto vec = Vector2(step.direction) * mag; - const auto from_accum = offset_frac_ * inv_frac * vec; + const auto from_accum = offset_frac * inv_frac * vec; auto offset_ = vec + from_accum; auto off_i = Vector2i(offset_); //Debug{} << "vec" << vec << "mag" << mag << "off_i" << off_i << "offset_" << C.offset_frac_; @@ -479,7 +479,7 @@ auto critter::move_toward(size_t& index, Ns& dt, const point& dest) -> move_resu if (!off_i.isZero()) { auto rem = Math::fmod(offset_, 1.f).length(); - offset_frac_ = Frac(rem * frac); + offset_frac = Frac(rem * frac); //Debug{} << "foo1" << C.offset_frac_; if (can_move_to(off_i)) { @@ -497,7 +497,7 @@ auto critter::move_toward(size_t& index, Ns& dt, const point& dest) -> move_resu else { auto rem = offset_.length(); - offset_frac_ = Frac(rem * frac); + offset_frac = Frac(rem * frac); } } @@ -508,7 +508,7 @@ auto critter::move_toward(size_t& index, Ns& dt, const point& dest) -> move_resu //Debug{} << "bad"; set_keys(false, false, false, false); delta = {}; - offset_frac_ = {}; + offset_frac = {}; return { .blocked = true, .moved = moved }; } diff --git a/src/critter.hpp b/src/critter.hpp index c569bd33..38b5addf 100644 --- a/src/critter.hpp +++ b/src/critter.hpp @@ -53,7 +53,7 @@ struct critter final : object Script<critter_script, critter> script; String name; float speed = 1; - uint16_t offset_frac_ = 0; // todo! remove underscore + uint16_t offset_frac = 0; bool playable : 1 = false; diff --git a/src/rotation.hpp b/src/rotation.hpp index 99f8c4a3..471007c3 100644 --- a/src/rotation.hpp +++ b/src/rotation.hpp @@ -8,6 +8,6 @@ enum class rotation : unsigned char { constexpr inline size_t rotation_BITS = 3; constexpr inline size_t rotation_MASK = (1 << rotation_BITS)-1; -constexpr inline rotation rotation_COUNT = rotation{1 << rotation_BITS}; // todo! remove +constexpr inline rotation rotation_COUNT = rotation{1 << rotation_BITS}; } // namespace floormat diff --git a/src/scenery-proto.hpp b/src/scenery-proto.hpp index 44c8fe6f..113660aa 100644 --- a/src/scenery-proto.hpp +++ b/src/scenery-proto.hpp @@ -28,7 +28,7 @@ using scenery_proto_variants = std::variant<std::monostate, generic_scenery_prot struct scenery_proto : object_proto { - scenery_proto_variants subtype; // todo! add std::monostate + scenery_proto_variants subtype; scenery_proto() noexcept; ~scenery_proto() noexcept override; diff --git a/src/world.hpp b/src/world.hpp index fe434e17..c8084614 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -49,7 +49,7 @@ private: explicit world(size_t capacity); - void do_make_object(const std::shared_ptr<object>& e, global_coords pos, bool sorted); // todo! replace 2nd arg with chunk& + void do_make_object(const std::shared_ptr<object>& e, global_coords pos, bool sorted); // todo replace 2nd arg with chunk& void do_kill_object(object_id id); std::shared_ptr<object> find_object_(object_id id); |