mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-17 15:18:11 +00:00
ULTIMA8: Finish actor turn with stand animation instead appending after turn.
This prevents a head snaping animation at the of a turn and allows the next queued animation to not have an addition wait before starting.
This commit is contained in:
parent
d7ea3450e3
commit
17d73513cc
@ -584,6 +584,7 @@ uint16 Actor::turnTowardDir(Direction targetdir) {
|
||||
standanim = Animation::surrenderStand;
|
||||
}
|
||||
|
||||
ProcId animpid = 0;
|
||||
ProcId prevpid = 0;
|
||||
|
||||
// Create a sequence of turn animations from
|
||||
@ -600,28 +601,22 @@ uint16 Actor::turnTowardDir(Direction targetdir) {
|
||||
|
||||
bool done = false;
|
||||
for (Direction dir = curdir; !done; dir = Direction_TurnByDelta(dir, stepDelta, mode)) {
|
||||
ProcId animpid = doAnim(turnanim, dir);
|
||||
Animation::Sequence nextanim = turnanim;
|
||||
if (dir == targetdir) {
|
||||
nextanim = standanim;
|
||||
done = true;
|
||||
}
|
||||
|
||||
animpid = doAnim(nextanim, dir);
|
||||
if (prevpid) {
|
||||
Process *proc = Kernel::get_instance()->getProcess(animpid);
|
||||
assert(proc);
|
||||
proc->waitFor(prevpid);
|
||||
}
|
||||
|
||||
done = (dir == targetdir);
|
||||
prevpid = animpid;
|
||||
}
|
||||
|
||||
ProcId animpid = prevpid;
|
||||
if (turnanim != standanim) {
|
||||
animpid = doAnim(standanim, targetdir);
|
||||
if (prevpid) {
|
||||
Process *proc = Kernel::get_instance()->getProcess(animpid);
|
||||
assert(proc);
|
||||
proc->waitFor(prevpid);
|
||||
}
|
||||
}
|
||||
|
||||
return animpid;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user