- if Lua_V2::SetActorGlobalAlpha() is called with a mesh name,
set a mesh-specific alpha value / mode
- use this alpha value in drawEMIModelFace()
- fixes the problem that the whole actor vanishes in some scenes
(e.g. when entering or leaving the porch of the of LUA bar)
Sometimes a texi component may refer to a material that was initialized by some other costume than the owner costume of the texi component. For example, the candles in gmi have a costume "fx/aura1.cos" that controls the animation of a material originally initialized by a sprite component of "fx/candle.cos".
The playing chores list may contain chores that have been stopped during the current frame. Stopped chores will be removed from the list on the next costume update. Drawing stopped components caused flicker when entering the closeup at Stan's house.
This adds math classes for doing frustum culling in software. These could be used for optimizing performance in many other places as well. For example, if an actor is outside the view frustum, it may not be necessary to do expensive keyframe animation and vertex skinning calculations for that actor.
Previously chore instance IDs stored as Lua userdata became invalid after
loading a save, because the chores were recreated with different IDs. This
caused certain opcodes like StopChore to fail.
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.
The hold chore was always lost after e.g. turning left or right.
Although that chore was still in _playingChores, it was not shown.
The patch uses the following order for drawing the chores:
- wear chores
- rest chores
- walk/turn chores
- other chores (in order of the playChore calls)
When multiple meshes in an EMI costume use the same material each will have
its own Grim::Material instance. If a material used by multiple meshes is
changed by a texi chore the instances will become inconsistent.
With this patch materials are managed by the costume, and there will only
be one instance of each reference material.
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.
EMICostume overrides the parent class's saveState/restoreState methods with
NOP functions, causing a great number of graphical glitches after restoring
a savegame. EMI costumes do not seem to have any additional dynamic state,
so the parent save and restore methods work just fine.