Commit graph

950 commits

Author SHA1 Message Date
Kaloyan Chehlarski
4d5c4fcfcc NANCY: Rename graphics and cursor managers
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.
2024-02-11 00:41:29 +01:00
Kaloyan Chehlarski
3a6e2562dd NANCY: Implement nancy8 TileMove puzzle
Added support for the changes nancy8 made to the
TileMove puzzle type. Specifically, an optional exit button,
and a timer with graphics that indicate how much time the
player has left.
2024-02-11 00:41:29 +01:00
Kaloyan Chehlarski
07a95628bb NANCY: Fix nancy1 crash
Fixed a crash caused by the recent changes to the way
the clock is accessed.
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
afbeb4ab8c NANCY: Support Conversation response add rules
Conversation responses have rules for how they should
be added to the list (just add, add at end, or remove),
which until now have been ignored. It's unclear if these
have ever been used, since scanning for them is hard.
Also, conditional responses are now added after the
regular ones.
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
b85ede6c9a NANCY: Correctly evaluate Conversation orFlags
The previous implementation of ConditionFlags' orFlag
checking did not account for chained orFlags. This struct
is seldom used, so it's unclear what, if anything, was
affected by this issue.
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
0f4ce35613 NANCY: Add support for nancy8 PianoPuzzle
The puzzle is used for the harmonica item, and adds
two special hover cursors.
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
c0a529c763 NANCY: Add sensible default listener on new scene
Whenever a SceneChangeDescription is constructed
manually (e.g. in Conversation), it now has its
listenerFrontVector initialized with the default value
(pointing straight forward).
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
b508ea4740 NANCY: Add sensible sound defaults 2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
477006c8a9 NANCY: Add PopScene() failsafe
When trying to pop an item scene with none pushed,
PopScene will now attempt to pop a regular pushed scene.
2024-02-10 13:27:12 +01:00
Kaloyan Chehlarski
f5aef15d69 NANCY: Allow invalid item ids in some Scene functions
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.
2024-02-10 13:27:11 +01:00
Kaloyan Chehlarski
4558690ec9 NANCY: Implement GoInvViewScene record type
This record goes to an item's associated scene, and
(optionally) adds it to the inventory if it's not already
present in it.
2024-02-10 13:27:11 +01:00
Kaloyan Chehlarski
5683e5f6e6 NANCY: Implement even terser Conversation records
Implemented the ConversationSoundTerse and
ConversationCelTerse action records, which are even
shorter variants of the corresponding Conversation types.
Made changes to the base ConversationSound to reduce
code duplication.
2024-02-10 13:27:11 +01:00
Kaloyan Chehlarski
ff39bce6ea NANCY: Implement drawing Autotext marks
Marks are the special symbols introduced in nancy8,
and are used in the task list to mark done/not done tasks
using a checkmark graphic.
2024-02-08 23:12:33 +01:00
Kaloyan Chehlarski
80d351969d NANCY: Implement TextScroll and AutotextEntryList
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.
2024-02-08 23:12:14 +01:00
Kaloyan Chehlarski
b51cb98d42 NANCY: Read MARK chunk
Added a struct corresponding to the MARK boot chunk,
which contains the source rects for the autotext markings
introduced in nancy8 (and used in the journal).
2024-02-08 23:12:14 +01:00
Kaloyan Chehlarski
0b8e43f65f NANCY: Implement jornal-editing action records
Implemented the AddListEntry, DeleteListEntry, and
MarkListEntry action records. These are responsible for
modifying the list of autotext strings for each autotext
surface. Also, the JournalData struct now includes data
for entry marking. The last change breaks compatibility
with nancy6+ saves.
2024-02-08 23:12:14 +01:00
Kaloyan Chehlarski
8745a64dfc NANCY: Implement ValueTest
Implemented the record type responsible for actually
checking the values inside TableData.
2024-02-07 23:15:23 +01:00
Kaloyan Chehlarski
a8dcc387a4 NANCY: Implement SetValueCombo
Implemented the action record type that computes a
sum of values, each one with an attached percentage
weight. The values themselves can be either supplied
verbatim, or extracted from the TableData struct.
This was implemented in nancy8, but only started getting
used in nancy9.
2024-02-07 23:15:23 +01:00
Kaloyan Chehlarski
1369449374 NANCY: Implement SetValue
Added support for the simplest of the data access action
records. This simply sets or adds to a value inside the
TableData struct.
2024-02-07 23:15:23 +01:00
Kaloyan Chehlarski
af2ff22907 NANCY: Split data-related records to separate file
Created a new header file for action records that mainly
serve to manipulate data. This is done in preparation for the
addition of SetValue, SetValueCombo, and ValueTest.
2024-02-07 23:15:23 +01:00
Kaloyan Chehlarski
f5311cfe87 NANCY: Expand TableData struct
From nancy8 on, a new method of writing and evaluating
data started being used. This commit expands the existing
TableData struct to accommodate it.
2024-02-07 23:15:23 +01:00
Kaloyan Chehlarski
7682560cc7 NANCY: Add detection for nancy10 & 11
The games absolutely will not run yet, but they're useful
to have around so their data can be inspected.
2024-02-07 23:15:23 +01:00
Kaloyan Chehlarski
a45a521ff5 NANCY: Disambiguate detection entries
Added more rigid entries for some game variants where
the ciftree.dat file is not present inside the cabfiles. Now,
those entries require a second file that can only be found
when the cabs are extracted.
2024-02-07 23:15:23 +01:00
Kaloyan Chehlarski
5b2929ce4d NANCY: Fix kThroughBlack special effects
The transition type that fades to black, and then to the
next scene now no longer gets stuck on a black screen
forever.
2024-02-06 20:32:28 +01:00
Kaloyan Chehlarski
a2f6f38105 NANCY: Fix Overlay crash in nancy7 2024-02-06 20:32:28 +01:00
Kaloyan Chehlarski
dd749d6042 NANCY: Add Bink support to play_video command 2024-02-06 20:32:28 +01:00
Kaloyan Chehlarski
d6016dfbc6 NANCY: Proper fix for nancy7 movie fades
This commit makes changes that ensure the nancy7
dog scare sequence will have the correct fades to black
without impacting other scene transitions. This is achieved
by delaying full-screen movies by exactly one frame.
2024-02-06 20:32:28 +01:00
Kaloyan Chehlarski
d468406f25 Revert "NANCY: Fix fades in nancy7 dog scare sequence"
This reverts commit 1f5a3c64cc.

The changes in this commit break other fades in nancy7.
2024-02-06 20:32:28 +01:00
Kaloyan Chehlarski
66a7fdb58e NANCY: Implement SpigotPuzzle
Implemented the AR responsible for nancy7's spigot puzzle.
2024-02-06 20:32:27 +01:00
Kaloyan Chehlarski
716041603d NANCY: Carry over unshown text to next scene
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.
2024-02-06 20:32:27 +01:00
Kaloyan Chehlarski
482da55d33 NANCY: Fix drawing of MouseLightPuzzle
Previously, the record worked based on the assumption that
its background will be completely black. This is not the
case in several nancy7 scenes. To support it, an additional
4-byte ARGB pixel format is now allowed in the engine, since
we need to be able to set an alpha value for the surface.
2024-02-06 20:32:27 +01:00
Kaloyan Chehlarski
c49c10432c NANCY: Respect text end marker
It appears the <e> marker also expects the text
renderer to ignore everything past it. Doing so fixes the
broken string in nancy7 scene 5770.
2024-02-04 16:29:55 +01:00
Kaloyan Chehlarski
1483cb1834 NANCY: Fix switching between item scenes
When inside an item's scene, opening another item's
scene no longer softlocks the game.
2024-02-04 16:29:55 +01:00
Kaloyan Chehlarski
5b15c4c6f0 NANCY: Fix incorrect navigation AR name 2024-02-04 16:29:55 +01:00
Kaloyan Chehlarski
898903f535 NANCY: Fix reading of SetVolume AR 2024-02-04 16:29:55 +01:00
Kaloyan Chehlarski
140a8a209b NANCY: Get rid of PlaySecondaryVideo parameter
Was completely functionless, and multiple channels don't
seem to be used after TVD anyway.
2024-02-04 16:29:55 +01:00
Kaloyan Chehlarski
283dcbb2f5 NANCY: Support nancy7 RippedLetterPuzzle
The puzzle got some changes in nancy7, allowing it to
only rotate 180 degrees or skip rotation entirely, and just
reorder elements instead. Also, a custom pick up graphic
can be used instead of the individual elements; this is used
in the folder reordering puzzle, where a picked up folder
is shown in full.
2024-02-04 01:30:30 +01:00
Kaloyan Chehlarski
fde77e4312 NANCY: Implement custom cursors
Added support for the two (four) custom cursor types.
It's unclear where exactly these get used, but it's most likely
in some puzzles.
2024-02-04 00:32:40 +01:00
Kaloyan Chehlarski
1357331fb0 NANCY: Accurately set sound flags in nancy8
In nancy8 the point at which flags in sounds got moved,
so now the flag is set at the beginning of the sound
instead of at the end.
2024-02-03 22:52:09 +01:00
Kaloyan Chehlarski
f456169631 NANCY: Implement PlaySoundEventFlagTerse
Used in nancy8; same as PlaySoundTerse, but also has
an event flag.
2024-02-03 22:52:09 +01:00
Kaloyan Chehlarski
358ea5a2cf NANCY: Add "fix softlocks" option to nancy6 & 7 2024-02-03 22:52:09 +01:00
Kaloyan Chehlarski
98c9291682 NANCY: Rename incorrectly named parameter 2024-01-31 22:55:57 +01:00
Kaloyan Chehlarski
de55da6ae4 NANCY: Correctly load nancy8 LOAD chunk
In nancy8, the save/load menu got a rewrite, and its data
is incompatible with the older version. This commit
introduces a new struct type for the new LOAD data,
and makes sure it is loaded. This allows nancy8 to boot.
2024-01-31 22:55:57 +01:00
Kaloyan Chehlarski
2eda922e73 NANCY: Clip Autotext contents of PeepholePuzzle
When using an Autotext surface as a source, PeepholePuzzle
will no longer scroll past the bottom of its text contents.
This was only implemented in nancy7, but I'm leaving
it enabled in nancy6 as well, since it's a nice QOL feature.
2024-01-31 22:55:57 +01:00
Kaloyan Chehlarski
f3fee34f42 NANCY: Indent Autotext when wrapping
Replicating a bug in the original engine, where a value
from TBOX is used in all rendering, resulting in all wrapped
textlines appearing slightly indented inwards.
2024-01-30 23:13:12 +01:00
Kaloyan Chehlarski
9a549a88b2 NANCY: Implement Autotext images
Added support for images inside Autotext. Used extensively
in nancy7.
2024-01-30 23:13:12 +01:00
Kaloyan Chehlarski
b43b66dcc6 NANCY: Change the font height calculation in nancy6
This ensures the text can be (nearly) pixel-perfect.
2024-01-30 23:13:12 +01:00
Kaloyan Chehlarski
a6e9cd3424 NANCY: Fix resource leak when shutting engine down
ActionRecords weren't being deleted, which resulted in
memory leaks and files being kept open.
2024-01-30 23:13:12 +01:00
Torbjörn Andersson
a1c8db3201 JANITORIAL: Clean up some whitespace and double semicolons 2024-01-29 19:32:00 +01:00
Kaloyan Chehlarski
9f63b7c572 NANCY: Fix Overlay in nancy7 scene 3600
The scene in question is yet another edge case, since it
draws more than one rectangle over a single viewport frame.
2024-01-28 02:07:46 +01:00