diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-11 16:27:46 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-11 16:27:46 +1000 |
commit | d255328476f1d3dd76bfd1dec550fddeab7c11ba (patch) | |
tree | 7bd11ae0952b05cee60a8ad527cd99818fabc6c0 /source/game/StarHumanoid.cpp | |
parent | e3ab4485539ef2e84a4c9478ffe56f48e30fee42 (diff) |
Humanoid: apply globalOffset *before* rotation
the globalOffset is meant to realign the sprite with the collision poly - applying it after rotating the drawables is bad! (I actually ACCIDENTALLY fixed this in StarExtensions and only noticed the difference today. quite incredible)
Diffstat (limited to 'source/game/StarHumanoid.cpp')
-rw-r--r-- | source/game/StarHumanoid.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/game/StarHumanoid.cpp b/source/game/StarHumanoid.cpp index c69872b..b19410a 100644 --- a/source/game/StarHumanoid.cpp +++ b/source/game/StarHumanoid.cpp @@ -528,7 +528,7 @@ List<Drawable> Humanoid::render(bool withItems, bool withRotation) { auto addDrawable = [&](Drawable drawable, bool forceFullbright = false) { if (m_facingDirection == Direction::Left) drawable.scale(Vec2F(-1, 1)); - drawable.fullbright = drawable.fullbright || forceFullbright; + drawable.fullbright |= forceFullbright; drawables.append(std::move(drawable)); }; @@ -792,12 +792,12 @@ List<Drawable> Humanoid::render(bool withItems, bool withRotation) { drawables.insertAllAt(0, m_altHand.nonRotatedDrawables); } - if (withRotation) - Drawable::rotateAll(drawables, m_rotation); - - Drawable::translateAll(drawables, m_globalOffset); - Drawable::rebaseAll(drawables); - + for (auto& drawable : drawables) { + drawable.translate(m_globalOffset); + if (withRotation && m_rotation != 0) + drawable.rotate(m_rotation); + drawable.rebase(); + } return drawables; } |