Commit graph

156 commits

Author SHA1 Message Date
Kaloyan Chehlarski
b9aa46c4df NANCY: Merge LOAD structs 2024-05-05 21:03:05 +02:00
Kaloyan Chehlarski
b1a861b50d NANCY: JANITORIAL: Fix trailing whitespace/tabs 2024-02-19 20:46:17 +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
758db1bfb1 NANCY: Fix memory leak when reading .dat file 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
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
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
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
ccca59475c NANCY: Support modified nancy.dat format
Added support for the freshly modified nancy.dat. The
previous version is also supported and will be kept that way
until the next time nancy.dat gets updated in master
(most likely after work on nancy8/9 is finished)
2024-01-16 22:26:55 +01:00
Kaloyan Chehlarski
e97c93f276 NANCY: Remove PLG0 flag from detection
Removed the detection flag that was used to mark a
specific nancy3 version with 1 extra byte in its BSUM.
Instead, a heuristic has been added to the BSUM reading
code that checks for it at runtime.
2024-01-11 23:04:14 +01:00
Kaloyan Chehlarski
3cb405f512 NANCY: Fix state changing
This fixes a regression in changing states that would
result in the player being able to continue or save the game
after losing/winning.
2024-01-09 23:06:48 +01:00
Kaloyan Chehlarski
586225d614 NANCY: JANITORIAL: Spaces to tabs / double spaces
Fixed all cases where spaces were used instead of tabs, and
all cases where a space was erroneously doubled.
2023-12-28 23:58:17 +02:00
Le Philousophe
1c2d757dbd NANCY: Migrate engine to Path 2023-12-24 13:19:25 +01:00
Eugene Sandulenko
ec2dd2726b ENGINES: Added optional parameter to canSave/LoadGameStateCurrently() for indicating the reason 2023-12-08 12:21:16 +01:00
Kaloyan Chehlarski
6f6625e3a2 NANCY: Add support for nancy5 Russian fonts
The Russian translations of nancy5 and up (except for
nancy6) switched to a Windows-1251 encoding for their
strings, and changed up the format of the FONT chunks.
2023-11-05 13:21:13 +02:00
Kaloyan Chehlarski
63f720a330 NANCY: Implement reading patches from nancy.dat
Added facilities for reading patch files embedded within
nancy.dat. The patches are distributed as a single ciftree,
which is loaded (almost) normally into SearchMan. However,
patches can also be enabled/disabled at will via specific
ConfMan entries, whose names are also embedded within
nancy.dat, and read at runtime.
2023-11-02 11:41:22 +02:00
Kaloyan Chehlarski
74307deca6 NANCY: Rewrite resource handling
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.
2023-10-26 19:46:32 +03:00
Kaloyan Chehlarski
56b48f6186 NANCY: Add GetEngineData macro
Added a macro that hides away the ugly casts whenever
an EngineData object is requested.
2023-10-12 12:42:28 +03:00
Kaloyan Chehlarski
7e6d37276b NANCY: Add support for nancy7's "More Nancy Drew!"
Made changes to BSUM reading, MainMenu and Scene states
needed to support the promo button in nancy7's main menu.
2023-10-02 12:19:31 +03:00
Kaloyan Chehlarski
2d68dd87a3 NANCY: Main loop fixes
Made sure that the main loop doesn't run for a frame longer
than it should when quitting the game. Also fixed the checks
for suppressed graphics so they now actually work.
2023-10-02 12:19:30 +03:00
Kaloyan Chehlarski
82c3d2ae0b NANCY: Implement table indexing record types
Added support for three different action records types
(TableIndexOverlay, TableIndexPlaySound, and
TableIndexSetValueHS), all of which use nancy6's newly-
introduced TABL chunk, which describes a table of values
that can be changed through interaction. This is used
in nancy6's museum narrations puzzle.
2023-09-24 17:43:28 +03:00
Kaloyan Chehlarski
a864756a67 NANCY: Fix BSUM reading for most nancy3 versions
It seems the version of nancy3 I use for testing is slightly
different from the one that was shipped originally, and the
one currently being sold on Steam. Notably, it features a
slightly different BSUM format not found in later games,
with the difference being there to support the Dreamcatcher
logo shown in the beginning. This commit fixes every other
version, which do not have that extra logo or bit.
2023-09-22 13:37:26 +03:00
Kaloyan Chehlarski
ee42466559 NANCY: Print additional info alongside errors
Added an override to the errorString() method, allowing
the engine to print additional data when an error is thrown.
2023-09-19 17:38:24 +03:00
Kaloyan Chehlarski
6b719b4b44 NANCY: Read CVTX chunks
Added code for reading CVTX chunks, which contain
an array of key-value pairs of strings (introduced in nancy6).
2023-09-14 22:54:17 +03:00
Kaloyan Chehlarski
7f8d6a47d3 NANCY: Avoid flashing cursor when changing scene
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.
2023-09-12 19:43:30 +03:00
Kaloyan Chehlarski
b918029f01 NANCY: Move PCAL chunk reading
The PCAL chunk is no longer an exception to the
way BOOT chunks are read and processed; it now has
its own struct type and can be accessed through
getEngineData().
2023-09-09 12:49:30 +03:00
Kaloyan Chehlarski
03d4791ed2 NANCY: Implement standard way to access boot chunks
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.
2023-08-31 12:20:39 +03:00
Kaloyan Chehlarski
cb60680d37 NANCY: Use original menus by default 2023-08-28 19:53:33 +03:00
Kaloyan Chehlarski
1bb5d42a2e NANCY: Implement save prompt on quit
Later games added a prompt to save before quitting, which is now implemented.
2023-08-28 19:53:33 +03:00
Kaloyan Chehlarski
f25b6e42a7 NANCY: Implement original load/save menu 2023-08-28 19:53:33 +03:00
Kaloyan Chehlarski
417669db9b NANCY: Reserve a special slot for Second Chance saves
Second Chance saves have been moved to their own save
slot, which is now write-protected.
2023-08-28 19:53:33 +03:00
Kaloyan Chehlarski
f3b5237a82 NANCY: Show partner logo on game start
Games after nancy2 had a second logo that appeared on
startup, which is now also shown.
2023-08-28 19:53:32 +03:00
Kaloyan Chehlarski
17f9b48b2d NANCY: Pause all sound in GMM 2023-08-28 19:53:32 +03:00
Kaloyan Chehlarski
00c7f4d128 NANCY: Implement setup menu
Implemented the Setup menu, which handles game settings.
Also made some fixes to MainMenu.
2023-08-28 19:53:32 +03:00
Kaloyan Chehlarski
7b11d63558 NANCY: Re-enable original main menu
Fixed up all the old commented-out menu code and made
it useable again. Added support for at least up to nancy5's
main menu. For now, several buttons have been left disabled
and the menus are only accessible through a hidden
config option.
2023-08-28 19:53:31 +03:00
Kaloyan Chehlarski
e761b5ae25 NANCY: Implement deferred loading for RaycastPuzzle
Added facilities for deferred loading of data that would take
far too long for a single frame. Deferred loading is
executed after the regular loop, where the system would
previously just sleep. Added deferred loading to RaycastPuzzle, which now no longer freezes the game
while initializing.
2023-08-23 12:15:06 +03:00
Kaloyan Chehlarski
d8fe9cb4c1 NANCY: Implement new nancy.dat format
The new nancy.dat structure is now read correctly by
the engine. As a result, sound channels are no longer
hardcoded, and some new logic has been added to
dialogue condition handling.
2023-08-10 14:28:50 +03:00
Eugene Sandulenko
f94464ecb1
NANCY: JANITORIAL: Remove trailing spaces 2023-08-07 10:47:50 +02:00
Kaloyan Chehlarski
a7e063e71f NANCY: Partially implement RaycastPuzzle
Added code to support nancy3's raycasted maze minigame.
The minigame (mostly) works but is not yet completable,
and needs further optimization work.
2023-08-06 19:29:10 +03:00
Kaloyan Chehlarski
15afae7277 NANCY: Add detection for Russian nancy 3/4 variants
Also added entries in the GameType enum for games 4-6.
2023-05-10 16:57:34 +03:00
Kaloyan Chehlarski
dff9cbe272 NANCY: Use correct values for nancy3's flags
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.
2023-05-10 16:57:33 +03:00
Kaloyan Chehlarski
9d18181318 NANCY: Implement SpecialEffect
Implemented the SpecialEffect action record, which
handles crossfading between scenes and fades to black.
2023-04-20 18:00:23 +03:00
Kaloyan Chehlarski
c8dfd05140 NANCY: Use RandomSource::generateNewSeed() 2023-04-19 15:02:30 +03:00
Kaloyan Chehlarski
970d6c961e NANCY: Do not autosave when scene is not running
Fixed an issue where autosaves would trigger when loading
a game from the launcher, resulting in an invalid save.
2023-04-16 15:40:51 +03:00
Kaloyan Chehlarski
76310e9ef9 NANCY: Implement nancy2 Conversation ARs
Implemented the three Conversation action record types
introduced in nancy2. These replace primary video, with
ConversationVideo being just a renamed
PlayPrimaryVideoChan0.
2023-04-14 22:39:09 +03:00
Kaloyan Chehlarski
e5aa308769 NANCY: Remove custom engine settings dialog
Replaced nancy's custom settings dialog with metaengine's
extra GUI options feature.
2023-04-09 15:52:15 +03:00
Kaloyan Chehlarski
4f10a4c08e NANCY: Coverity issues fixes 2023-04-09 15:52:14 +03:00
Kaloyan Chehlarski
4b3b81eb52 NANCY: Change where states are entered and exited
Moved the calls to onStateEnter() and onStateExit() inside the main game
loop.
2023-04-06 18:17:17 +03:00