It may be because of an underlying bug, but there is at least one
case where a script is unloaded and replaced by another script while
that script slot still has an active subtitle. This causes it to
print random garbage for me, and may be causing crashes for others.
I've discussed this patch with johndoe, and he was ok with it, so
let's see how it works out.
This doesn't behave quite like the original - it seems the original
does not take the fake last entry into account when saving? - but I
think it's actually a bit more consistent this way.
Before, the main updateInput() might swallow attempts at aborting
movies. Now all events are handled by the movie player's own
handleInput(). As a side effect, it's no longer necessary to check
if a movie is playing before removing subtitles when pressing space.
Both the "wobble" and the positions were slightly off. I didn't
want to change _verbLineY because for one thing it doesn't seem to
affect the drawing of the verbs, and for another it seems to be
stored in savegames because... squirrel!
I don't know how often the original shook the screen (perhaps as
often as it could?), but at least we now have the opportunity to
shake the screen more than once per movie frame.
All this does is to offset the image when copying it to the screen,
and offset the position when checking for clickable items at specific
coordinates. It looks and works right to me. I guess that just leaves
the buildColorTransTable2() function, but I'm useless for that so
someone else will have to look into it.
At least on my computer, the sound would stall frequently after a
while because the delay between frame was calculated from frame to
frame. Now it's calculated from the start of the sound instead.
I'm guessing that the unused _top variable is what causes the main
menu to be drawn at the wrong position at the very start of the
game. At that point, it's 30 which seems to be by how much the Y
coordinate is off.
The shadeRect() function is called just once (at the time of writing)
and immediately afterwards the "front screen" is copied to the
"background". Therefore, drawing to the background doesn't seem to
make any sense.
The colors are wrong, but I assume that's for the same reason that the
text colors are wrong as well.