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.
The addItemToInventory() and removeItemFromInventory()
were still using uints, which meant that if they were
somehow called with an id of -1 (which marks an invalid
item), they'd crash the engine. This shouldn't matter for
regular play, but may occur when debugging.
A couple of scenes in nancy7 draw to the textbox, then
immediately change the scene, which clears said text.
This commit adds a check for whether text was actually
drawn, and if it hasn't, makes sure it is shown in the next
scene. This is behavior not present in the original engine.
Fixed the CLOK chunk reading, so the parameters that
indicate whether the clock is the day clock (nancy5), or
completely disabled (nancy7) now get read correctly.
Added a feature that stores whether the player has won
the game at least once, and activates a specific event flag
if so. This may or may not enable easter eggs in the
game data, but definitely affects the (still unimplemented)
quotes easter egg in the version screen.
Fixed an oversight with syncing nancy7 savefiles where
the inventory ID of an inventory scene would not get saved,
and cause a crash when attempting to exit said scene after
loading.
Some fades to black were not being shown correctly,
since from nancy7 on ActionRecords seem to start executing
only after SpecialEffects were done animating.
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().
Fixed several issues with the nancy7 ad button:
- the sound in the main menu no longer cuts out when
returning from the ad
- an ad scene now never ends up in a second chance save
- going to the ad 2 times in a row does no longer continues
the game instead.
Also, the GotoMenu record now always forces the player
back to the menu, even when original menus have been
disabled; the old behavior never made sense.
This fixes some weird behavior in scenes that use the
kSound dependency type. When the player clicks a trigger
that plays a sound, but saves the game while the sound
is being played, that trigger may end up disabled on load,
breaking the game.
Since we don't adjust TVD's cursor hotspot, we need to make
sure that the cursor warping during conversations does
not go above the line at the bottom of the Viewport
With the adjustments made to the regular cursor, the
inactive zone during conversations was rendered a few
pixels shorter than it should be; now the cursor can be moved
up right up to the edge of the viewport.
Also, when entering a conversation, the mouse cursor would previously warp immediately, but its graphic would only change
a frame later; this has also been fixed
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.
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.