915 Commits

Author SHA1 Message Date
Kaloyan Chehlarski
b1a861b50d NANCY: JANITORIAL: Fix trailing whitespace/tabs 2024-02-19 20:46:17 +01:00
Kaloyan Chehlarski
f89967c979 NANCY: Implement NewPhone
Added support for the new Telephone AR type, which
adds a cellphone display with a phone number directory,
a dial button, and conditional phone numbers.
2024-02-18 22:31:13 +01:00
Kaloyan Chehlarski
18eea6d464 NANCY: Add support for nancy9 RippedLetterPuzzle
In nancy9 this record got an upgrade allowing for an
extra solution, as well as duplicated elements.
2024-02-18 22:31:13 +01:00
Kaloyan Chehlarski
2e22962909 NANCY: Add support for TextBoxWrite with no string
Somewhere around nancy9 (may happen earlier, too),
the TextBoxWrite record added support for reading its
string from the Autotext chunk.
2024-02-11 22:53:22 +01:00
Kaloyan Chehlarski
f85277f82a NANCY: Add support for nancy9 SliderPuzzle
The record works identically to the one in nancy1, with
the exception that the start positions are no longer pulled
from a SPUZ chunk.
2024-02-11 22:53:22 +01:00
Kaloyan Chehlarski
88574bd47c NANCY: Fix crash in Conversation 2024-02-11 22:53:22 +01:00
Kaloyan Chehlarski
b2231ac3cd NANCY: Implement Autotext with hotspots
Added support for hotspots that link to a new scene,
as introduced in nancy9.
2024-02-11 22:53:22 +01:00
Kaloyan Chehlarski
e25018f892 NANCY: Allow later games to have 999 saves
Added a hidden ConfMan property that controls how many
saves are allowed, and added code that sets it to 8 at
startup, provided the game is nancy7 or earlier. This makes
sure that later games, which had infinite saves, can have
their save menus supported correctly.
2024-02-11 22:53:22 +01:00
Kaloyan Chehlarski
4541d085ca NANCY: Disable buttons/save when a Movie is active
The original engine specifically disables exiting the Scene
when a SecondaryMovie is playing.
2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski
5695018cd3 NANCY: Implement InteractiveVideo
Implemented an action record type that adds hotspots
on top of a SecondaryMovie.
2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski
01eefffad6 NANCY: Fix memory leak in ResourceManager 2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski
758db1bfb1 NANCY: Fix memory leak when reading .dat file 2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski
3d9a61f904 NANCY: Fix memory leak in Conversation 2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski
0c2e54416e NANCY: Update engine status comment 2024-02-11 00:41:30 +01:00
Kaloyan Chehlarski
ad21d8b566 NANCY: Fix ResourceManager memory leak
The ResourceManager was never getting deleted on
engine exit. Also, it is now instantiated in the engine
constructor, just like the other managers.
2024-02-11 00:41:30 +01:00
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 1f5a3c64cc89fca3e0d13afd24056756e65a2ff2.

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