Changed the names of the pointers to GraphicsManager
and CursorManager to be shorter, since they were
inconsistent with the rest of the managers, and typing
them out is a chore.
Added support for the record types that replaced the bare
Autotext, and combined it with a PeepholePuzzle. This
necessitates some ugly, diamond-shaped multiple
inheritance, but the original engine's solution of replacing
the current record with a different type one at runtime
is even uglier. Also, made changes to Autotext to correctly
support LIFO ordering.
Removed occurences of the ConfMan macro being used
to get the transient domain name. This makes sure we don't
generate unnecessary calls to ConfigManager::getInstance().
It seems earlier games were aware of the engine bug that
slows down all videos, and their movies were correctly synced
in the original engine. This commit duplicates that bug,
but only in the cases where a movie has an embedded sound
(e.g. the nancy2 cutscenes)
Implemented the correct logic for a cursor dependency
that specifies _not_ holding an item, though I'm still not
sure that functionality is actually ever used. The "can't"
sounds for such a dependency will now also play correctly.
The "standard" cursor dependency (which will activate
only if the player is not holding anything) will now actually
activate; previously it had no chance of doing so, due to
incorrect int signedness. Again, it is unclear if this ever
actually gets used.
Autotext records generate surfaces that are used by other
action records. When loading from a save, the Autotext
will already be marked as "done", and thus wouldn't generate anything, resulting in a crash. This commit makes
sure this doesn't happen.
It seems a scene change only interrupts the execution of
the rest of the ActionRecords in a scene starting from nancy4.
Adding the version check fixes the intro of nancy3, where
the narration wouldn't start playing.
Fixed all instances of dependencies that, once satisfied, stay
that way forever. This fixes more complex event flag
dependency like the one in nancy7 scene 2805.
It seems the kSceneCount dependency type has been
broken pretty much always, and the last attempt at fixing it
was a fluke. Also added checks for nancy7, since the devs
decided that, for whatever reason, the conditions need to
be flipped, and what was before a less-than check is now a
greater-than one, and vice versa.
Added support for a short variant of Hot1FrSceneChange,
which combines all the directional scene changes into one.
Due to the weird way the data is combined, significant
changes to the way ActionRecords are created had to be made.
Fixed the Dependency processing code so the rare cases
where a single ActionRecord has multiple CursorType
dependencies works correctly (plays the right "can't" sound,
removes/re-adds held items as indended). This fixes the
keymaker's return slot in nancy5.
Changed the ActionRecord processing logic so that
dependencies are evaluated regardless of whether the
record is active or not. This fixes nancy5 scene 3008, where
at the beginning of the game one would be unable to
get the phone call, and would instead hear the general
"can't" sound (which should never play).
Further ActionRecords now stop being processed as soon as
changeScene() is called, instead of getting one last frame
of processing. This fixes nancy4 scene 5708, where clicking
the gate circle would previously activate a sound effect
that it shouldn't
Added an improvement to the ActionRecord processing
code that fixes timing-related issues with secondary movies.
As a result, movies are now better-synchronized than they
ever were in the original engine.
Added a workaround for a bug in nancy3 where the engine
would move to an incorrect scene, because Overlay input
wasn't being handled with priority like it was in the original
engine.
Changed the ActionRecord loading code so that reaching
an unknown/changed record type just shows a warning
and continues, instead of throwing an error and quitting.
Implemented the action record type responsible for
overriding the default "I can't" sound for a specific item.
Also implemented closed captioning for the same use
case, since it had previously been overlooked.
Previously, the NancyEngine class was responsible for
handling creation and destruction of many naked pointers
to engine data, which led to several instances of memory
leaks that needed to be fixed. These changes introduce a
standard way of handling that same data, similar to the
one already used by PuzzleData inside Scene. Unfortunately,
this does add the need for relevant data to be casted to
the proper type before it is handled.
Fixed the dependency code so dependencies marked with
an orFlag can be chained (that is, we can have more than
two of them at a time). This makes the chiming clock in
nancy3 actually work.
nancy3 changed the way the kKeepAlways inventory flag
worked, and added a third flag with the old behavior. As
a result of this change, the suitcase key in nancy3 no longer
disappears after being used.
Items marked as single-use are now correctly removed from
the inventory. Also extended the get_inventory console
command to show if an item is single-use or not.
Nancy3 did away with earlier versions of the engine's usage
of 1 and 2 as false/true values. This commit adds two
new values to NancyEngine: _true and _false, which hold
the correct values used by different versions of the engine.
Nancy3 introduced the kOpenParenthesis and
kCloseParenthesis dependency types, which allow for
more complicated dependency logic. This commit changes
the structure of the DependencyRecord type to support
parent-child relationships similar to the ones found
inside the original implementation's code. Also introduced
is the static canHaveHotspot() function in ActionRecord,
which is used to correctly implement cursor dependencies.
Fixed the way the kElapsedPlayerTime dependency is handled,
so it ignores days and milliseconds. Also added support for
the conditions added in nancy3.
The counters for how many times each scene has been hit
now actually work, instead of always being 0. The data type
storing them has been changed to a HashMap to save
on memory.
Boot chunks BSUM, VIEW, INV, and TBOX are now read only at startup,
and their data is kept permanently inside NancyEngine. This removes the
need for the chunks to be read by multiple classes and always kept
in memory.