summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-03-23 19:13:52 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-03-23 19:13:52 +0100
commit908bef94cf701680dd0258826bdb5ea1f29e2316 (patch)
tree691e7753d9bad8d133f950bc4887d1ba53bf0807
parent38b7a0ae1ee5cd58a35e54d8ea6dc853ad744b89 (diff)
a
-rw-r--r--src/critter.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/critter.cpp b/src/critter.cpp
index ef3fd2a2..843036b4 100644
--- a/src/critter.cpp
+++ b/src/critter.cpp
@@ -99,7 +99,6 @@ constexpr std::array<rotation, 3> rotation_to_similar(rotation r)
}
template<rotation new_r, float vx, float vy>
-CORRADE_ALWAYS_INLINE
bool update_movement_body(size_t& i, critter& C, const anim_def& info)
{
constexpr auto vec = Vector2{vx, vy};
@@ -130,11 +129,11 @@ bool update_movement_body(size_t& i, critter& C, const anim_def& info)
}
template<rotation r>
-CORRADE_NEVER_INLINE
-bool update_movement_2(size_t& index, critter& C, const anim_def& info)
+CORRADE_ALWAYS_INLINE
+bool update_movement_2(size_t& i, critter& C, const anim_def& info)
{
constexpr auto vec = rotation_to_vec(r);
- return update_movement_body<r, vec.x(), vec.y()>(index, C, info);
+ return update_movement_body<r, vec.x(), vec.y()>(i, C, info);
}
template<rotation r>
@@ -164,9 +163,8 @@ bool update_movement_1(critter& C, size_t& i, const anim_def& info, uint32_t nfr
}
else
{
- constexpr auto vec = rotation_to_vec(new_r);
for (auto k = 0u; k < nframes; k++)
- if (!update_movement_body<new_r, vec.x(), vec.y()>(i, C, info))
+ if (!update_movement_2<new_r>(i, C, info))
return false;
}