The original logic doesn't hold up to testing. The position/width/height
of a sprite can be changed at any time without any extra flags; although
the screen needs to be redrawn before you can see any change.
The main thing that the sprite puppet flag does is determine if sprites
are updated from the score data when the frame changes.
Fixes the broken mouse cursor tracking sprite in Chop Suey.
Fixes the sprite scaling in the Doc Martens minigame in Virtual
Nightclub.
Fixes director-tests/D4-unit/T_SPRT01.DIR
After creating a bunch of tests, it is clear that the choice of what
mouseDown/mouseUp handler in the hierarchy to use is determined just
before running it. This was a problem, as we were caching that
information up-front when processing the input events, and it is
entirely possible for e.g. a mouseDown handler to jump to another frame,
which would affect which subsequent mouseDown/mouseUp handlers to call.
Fixes director-tests/D4-unit/T_EVNT01 to T_EVNT11.
If you trigger e.g. a mouseDown and a mouseUp event, the mouseUp event
should not be run until the mouseDown event has returned.
Fixes director-tests/D4-unit/T_EVNT03.DIR
Confirmed to work with:
- darkeye (race condition when viewing cutscenes or switching scenes in
the menu)
- gadget (race condition after climbing the stairs in GA28)
- the7colors (intro cutscene timed with b_delay)
- wallobee (hotspot select gated with b_delay)
Apparently it is possible to send events if there are no frames (e.g. a
movie with no Score data and a script which redirects to another movie).
Fixes occasional crashes when starting Team Xtreme: Operation Weather
Disaster.
- Add guardrails to m_forget
- Treat g_director->_currentWindow as a reference-counted copy
- Move MacWindowManager cleanup out of ~Datum into Window::decRefCount
This patch fixes the behaviour of having both scoped and scopeless lingo
in the same score script. It has been observed that movies created with
D3.1 that uses scopeless lingo can be ported to D4, in which case the
scopeless lingo is executed first, before the scoped lingo. (for example
in `put "abc" enterFrame put "enter" end`, abc will be printed first,
then enter)
Fix the problem where frames in certain `totaldistortion-win` movies are
played spontaneously because enterFrame handlers are not called due to
scopeless statements contained in the movie.
--start-movie="ATD/HD/FISMH2H6.DXR"@50 totaldistortion-win
Frames are now loaded on demand, when they are first accessed. Also
the starting offsets of each frames are stored in a special array, so
any previously visited frame might have quick access time. Much of the
work is done in Score class itself.
Warning: This commit is not yet complete. There are various issues
and crashes on the way.
Demand loading of frames is implemented to replicate the behavior of
the original engine. The original engine does not load frames until
it is accessed, this property when used with lingo is exploited to
allow changes in sprite properties when there is no next frame changes
of that property. In essential what happened was that for a non puppet
sprites, the game can have its property changed and rendered until there
was full refresh (in form of jumps, etc) of screen. This was not possible
with precached frames.
The first example use was seen in movie `ATD\HD\bdDREAMA.DXR` of game
'totaldistortion-win'.
In D5 and up, you can have multiple casts in the same movie, along with
external casts. Unlike shared casts these are different namespaces;
each movie maps the casts to a libId, which is then used by
CastMemberID.castLib.
For D4 and below, the default cast libId is now represented by
DEFAULT_CAST_LIB. This should make refactoring easier in future.
In Director 4, with score scripts it is possible for the compiler
to produce a generic handler which is empty, in addition to named
handlers (e.g. mouseUp). The original behaviour for sprite scripts
was to default to the generic handler if it exists, even if there
is a named handler that matches the event. This change makes the
generic handler the fallback choice.
Fixes opening the inventory in Eastern Mind.
This turns Object into a template so any type can easily act as a Lingo
object. For example, script objects no longer own a script context.
They *are* script contexts, and there are custom getters/setters for
methods and properties.