[Scummvm-git-logs] scummvm master -> ed174453fe967a97912b5ccf537af6c3773a1d32
aquadran
noreply at scummvm.org
Wed Oct 28 04:24:09 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
ed174453fe GRIM: Apply the actor time scale to movement
Commit: ed174453fe967a97912b5ccf537af6c3773a1d32
https://github.com/scummvm/scummvm/commit/ed174453fe967a97912b5ccf537af6c3773a1d32
Author: Joel Teichroeb (joel at teichroeb.net)
Date: 2026-10-28T05:24:04+01:00
Commit Message:
GRIM: Apply the actor time scale to movement
Time scale should affect movement as well as the already implemented
animation speed.
Assisted-by: Claude:claude-sonnet-5-5
Changed paths:
engines/grim/actor.cpp
diff --git a/engines/grim/actor.cpp b/engines/grim/actor.cpp
index b3377843879..5797e931027 100644
--- a/engines/grim/actor.cpp
+++ b/engines/grim/actor.cpp
@@ -565,7 +565,7 @@ bool Actor::singleTurnTo(const Math::Vector3d &pos) {
Math::Angle y, p, r;
calculateOrientation(pos, &p, &y, &r);
- float turnAmt = g_grim->getPerSecond(_turnRate);
+ float turnAmt = g_grim->getPerSecond(_turnRate) * _timeScale;
bool done = animTurn(turnAmt, y, &_yaw) == 0;
done = animTurn(turnAmt, p, &_pitch) == 0 && done;
done = animTurn(turnAmt, r, &_roll) == 0 && done;
@@ -797,11 +797,12 @@ void Actor::moveTo(const Math::Vector3d &pos) {
}
void Actor::walkForward() {
- float dist = g_grim->getPerSecond(_walkRate);
+ float dist = g_grim->getPerSecond(_walkRate) * _timeScale;
// Limit the amount of the movement per frame, otherwise with low fps
// scripts that use WalkActorForward and proximity may break.
- if ((dist > 0 && dist > _walkRate / 5.f) || (dist < 0 && dist < _walkRate / 5.f))
- dist = _walkRate / 5.f;
+ const float maxDist = _walkRate / 5.f * _timeScale;
+ if ((dist > 0 && dist > maxDist) || (dist < 0 && dist < maxDist))
+ dist = maxDist;
// Handle special case where actor is trying to walk but _walkRate is
// currently set to 0.0f by _walkChore to simulate roboter-like walk style:
@@ -1102,7 +1103,7 @@ void Actor::stopAllChores(bool ignoreLoopingChores) {
void Actor::turn(int dir) {
_walking = false;
- float delta = g_grim->getPerSecond(_turnRate) * dir;
+ float delta = g_grim->getPerSecond(_turnRate) * dir * _timeScale;
if (g_grim->getGameType() == GType_MONKEY4) {
delta = -delta;
}
@@ -1504,7 +1505,7 @@ void Actor::updateWalk() {
float dist = dir.getMagnitude();
_walkedCur = true;
- float walkAmt = g_grim->getPerSecond(_walkRate);
+ float walkAmt = g_grim->getPerSecond(_walkRate) * _timeScale;
if (walkAmt >= dist) {
walkAmt = dist;
_path.pop_back();
@@ -1549,7 +1550,7 @@ void Actor::update(uint frameTime) {
}
if (_turning) {
- float turnAmt = g_grim->getPerSecond(_turnRate) * _turnRateMultiplier;
+ float turnAmt = g_grim->getPerSecond(_turnRate) * _turnRateMultiplier * _timeScale;
_currTurnDir = animTurn(turnAmt, _moveYaw, &_yaw);
if (g_grim->getGameType() == GType_MONKEY4) {
_currTurnDir = -_currTurnDir;
More information about the Scummvm-git-logs
mailing list