Both the animation components/tracks and the chores itself keep track of
the current time independently:
animation component:
- AnimationStateEmi::_time
- initialized with 0
- after the first update() call, _time is advanced by the frametime
chores:
- Costume::_currTime
- initialized with -1
- during the first update() call, _currTime is set first to 0
- during the next update() call, _currTime is advanced by the frametime
EMICostume::update() updates first the chore and then all components
with the same frame time. This has the effect, that the internal time
base of the chore and the animation has always an initial offset (the
value of the frametime of the first update() call).
For some costumes, the chore will pause the animation by setting the
according key for that animation at the end of the animation. However,
since the animation component has a different time base, it has already
reached that point and may have already disabled itself entirely
(instead of just being paused by the chore).
This bug fix let the animation set _time to 0 in the first update() call, too.
Any consecutive update() call will advance the time by the frametime.
This will keep the two time bases of the chore and the animation component
in sync.
Fading out chores remain in playing state until they have completely faded out. Also using StopChore on a fading out chore will actually stop the chore, unlike in Grim where the chore will keep fading out.
Key 3 seems to control whether the animation loops or not. If key 3 is not
set, the animation plays once and then deactivates. If the key is set, the
animation will repeat until the chore is stopped.
Two animations (guy_puton_cap, guy_holdstickystuff) contain bone names
which which don't match any joints. To avoid that the holding actor is
drawn with a wrong orientation, ingore the unknown bone names when
running the animations.
Skeleton::getJointNamed() will now return null for unknown names.
The original behaviour for Actor::getWorldPos and
Actor::getRotationQuat is kept.
This patch fixes the problem, that Guybrush is "lying down" once he
holds the bottle of glue.
The current code for loading EMI costumes contains a special treatment that
expects the skeleton and mesh components in a chore named "wear_default".
This assumption is not valid for costumes that contains multiple wear chores,
most notably for Guybrush who has a different outfit for each island.
The new code considers any chore containing skeleton and mesh components
to be a wear chore. The skeleton from the last played wear chore will be
animated.