This fixes a crash in Hand of Fate when scaring off the rat by using the
swampsnake potion on Zanthia. This crash is timing sensitive since the game is
stopping the offending sound resource at this point. If it still gets to the
instruction setting up an invalid instrument, it will crash ScummVM with in
invalid read.
Formerly we only checked track1.$EXT but we also support track01.$EXT. Guess
this is a good example why we need to reconsider how we will handle detection
of presense of CD audio tracks in general...
Untangled the audio and video track from each other, and the parsing
of the stream from the decoding of its data. Also fixed a memory leak
as it turns out deleting a Surface doesn't free its data. You have to
call free() in it.
I have only checked the intro, not every cutscene, but that seems to
work fine at least.
As an alternative to using the Screen class's functions, we can let
the VQA decoder draw directly to the backend. This won't work if the
game uses "hi-res mode", but I don't think that's ever the case for
Malcolm's Revenge. I believe the KyraEngine_MR::playVQA() function
ensures that the screen is properly updated after the movie has
finished.
This almost limits the VQA rewrite to vqa.cpp and vqa.h. Whether it's
better this way than changing the Screen functions to take a 'pitch'
parameter...? I don't know. But it's an alternative.
Each engine now only has to provide a single configure.engine file
adding the engine into the configure script, which then produces the
required other files automatically.
This is the third and final commit enabling fully pluggable engines.
Now providing an engine folder contains a configure.engine, engine.mk
and engine-plugin.h file, it will be picked up automatically by the
configure script.
This is the second part of allowing engines to be added dynamically.
Each folder in engines/ which must contain a file named "engine.mk"
containing the make definitions for that engine.
This is the first part of allowing engines to be added dynamically.
They are placed into a folder in engines/ which must contain a file
named "configure.engine" to add the engine, which is pulled into the
top level configure script automatically.
Although I did not consult with disassembly, judging from the game
logic _unkEndSeqVar4 is used for switching certain Malcolm frames,
and it is apparent that this should happen only under condition,
not always.
This allows to keep the engines to specfiy the files for translation close to
the engine sources itself.
Thanks to criezy for his suggestion on this approach.