Some game timing events are based on ms elapsed, but we were just getting the
current ms when it was evaluated. This was not very consistent and could
potentially lead to weird problems, although in practice they were unlikely
Record the elapsed ms at the start of each frame so we can use the same
comparison point in every operation.
This includes the mini arcade games, as well as games with dedicated
logic, such as the shell game in HoC
Mini games for Dragon and HoC:
- Dragon: Arcade sequence: Fighting Snake (implemented)
- Dragon: Arcade: Reservoir (implemented)
- HoC: Tank 3D arcade sequence in Chengdu (missing)
- HoC: Shell game with street gambler in Istanbul (implemented)
- HoC: Train arcade sequence after Istanbul (missing)
In d26ee6, I changed the scene ops to always be executed to the end even if the
scene changed - this was not correct and it breaks scene 60 (police cutscene)
in Rise of the Dragon, which stores the current day into a variable - but if
run twice will leave the day as 999 after leaving.
The correct behavior is not to abort ops *only* in the case of scene change to
inventory. All other scene changes should still abort running scene ops.
Closer inspection shows the "move to front" and "move to back" ADS ops were the
wrong way around.
Unfortunately this breaks the rendering a bit - blade's shirt flashes on the
floor of the apartment at the start of dragon.
However, it's more correct and fixes other things - eg, turning off the tap in
the apartment. The rendering problem will need a different fix.
This was the bug that required a workaround for the ticket vendor in Heart of
China. The scene opened inventory (which makes the scene change) and then set
a global. We were never setting that global as expected.
This required a slight refactor in the way the scene ops are run.
Most dialogs now render correctly and the game is partly playable. Still a
bunch of work to do for inventory and menus to render correctly.
Added loading for TDS (talking head) data structures too, but they are not yet
used.