CifFile/CifTree classes have been completely rewritten and
moved to their own header file. ResourceManager is now
exclusively responsible for loading IFF files, making sure
loose .iff/.cif files take precedence before ones embedded
in a ciftree.
Also, completed work on the cif/ciftree exporting functions.
The SpecialEffect action record got some significant changes
in nancy7, including a new type of fade, and the removal
of the predefined number of frames to fade. Testing with the
original is tough, since it runs way too fast on modern PCs,
and the new fade type is never actually used properly, so
the current implementation is only an approximation. Also,
I've discovered that prior to these changes the entire screen
got crossfaded, so the screenshotViewport() function is now
entirely removed.
Added support for the new type of item introduced in nancy7,
which, instead of getting picked up, transports the player to
a new scene with a close-up view of the item.
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 PlaySoundTerse and
PlayRandomSoundTerse, as introduced in nancy7. Also
implemented the new functionality for reading closed
captioning text from the Autotext chunk.
The counters for how many times a scene has been
visited now get incremented only when we exit it. This
makes sure the counter is not incremented when loading a
save, and makes sure dependencies that require the
sceneCount to be equal to 0 can actually execute
(e.g. nancy6 scene 2319)
Pretty much all puzzles (except the telephone and alarm
clock, which aren't actually puzzles) force the currently
held item back into the inventory when they start, which is
now implemented.
Fixed an issue where RemoveInventoryNotHS would not
work correctly if the item was currently being held by the
player. This fixes the fire extinguisher in nancy3 remaining
in the inventory all the way until the end.
Clicking on a hotspot that triggers a "can't" sound will now
clear the textbox before pushing the caption. This makes
sure that the caption won't be displayed twice.
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.
Fixed an edge case where an error being thrown during
the very first time a Scene is loaded would result in a
chain reaction that would crash ScummVM while trying to
draw invalid data on screen. Instead, the error is now
properly shown on screen before quitting.
Also made changes to the savegame screenshot code to make
sure this change does not impact second chance saves.
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.
Fixed an issue where certain sound channels wouldn't get
paused when changing state. Collapsed the pause/unpause
functions inside Scene into a single function, and placed it
inside SoundManager.
In cases where the mouse falls inside a hotspot with the
same cursor type in both the previous and next scenes,
we now avoid a single frame where the cursor flashes to
the default and then back.
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.
There is at least one scene in nancy5 with more than 30
records. The check is pretty much useless anyway, since
we have a variable-size array of records while the original
engine didn't, so it has simply been removed.
The original engine allowed players to go to the main menu
via the Esc button, but only when they were in the Scene state.
This is now implemented here as well.
Fixed the way scrollbars are handled, at the cost of some
accuracy. As a result, moving the mouse outside of the
scrollbar's hotspot no longer stops it from moving.
The previous design, where the textbox kept its contents
unless it was explicitly cleared, was probably a leftover
from the early days of the engine, though I honestly can't
remember.
Added support for 3D sound, as introduced in nancy3.
The original engine used DirectSound 3D, which enabled
for easy sound panning, attenuation based on distance,
and doppler effect simulation. The DS3D algorithm
has only been approximated; in particular, there are some
minor differences when it comes to sound panning.
Fixed several inaccuracies with reading sound data. Added
enumerations describing the sound playing commands
introduced in nancy3. Added a flag for sound debugging,
which will be used in implementing said play commands.
changeScene() no longer takes the new scene data if Scene
is already in the kLoad state. This fixes an issue in nancy4's
suitcase, where two different SceneChange action records
have the exact same dependencies, and would both trigger
at the same frame. Thus, the second one would always
overwrite the first one, leaving the player stuck inside
the open suitcase.
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.
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.
Changed the way game-specific puzzle data is stored and
saved. Scene now holds a HashMap of lazily initialized
PuzzleData objects, each of which stores data for a specific
puzzle type. This helps avoid long switch statements in
the initialization and save/load code, and helps avoid
breaking savefiles every time a new puzzle type
is implemented.