Commit graph

82 commits

Author SHA1 Message Date
sluicebox
8e1d90f8e4 ALL: Remove clearAllDebugChannels() from Engine dtors 2021-06-14 12:42:38 -05:00
ysj1173886760
04d03fe7f0 NANCY: move debug channels to metaEngineDetection 2021-05-22 01:34:57 +02:00
Kaloyan Chehlarski
1079fac665 NANCY: Correctly read The Message in a Haunted Mansion boot summary
Nancy 3's BSUM chunk is now read correctly, although the game still
crashes at launch due to other issues.
2021-05-18 00:44:20 +03:00
Kaloyan Chehlarski
a921e495bf NANCY: Make Nancy Drew: Stay Tuned for Danger bootable
Nancy2's BSUM chunk is now read correctly and the game boots
without crashing.
2021-05-18 00:44:20 +03:00
Kaloyan Chehlarski
4d07619a3a NANCY: Add compressed nancy1 variant and improve detection
Added a compressed variant of the Russian translation of Nancy Drew:
Secrets Can Kill. Added a flag to mark compressed game variants and
only load archives when playing one. Removed the 8-bit colors flag.
2021-05-18 00:44:19 +03:00
Kaloyan Chehlarski
a82210b2db NANCY: Correctly load first scene in The Vampire Diaries
readBootSummary() now correctly extracts the first scene data and
the beginning player time from TVD's BSUM chunk.
2021-05-18 00:44:18 +03:00
Kaloyan Chehlarski
515000eb5e NANCY: Silence uninitialized variable warning 2021-05-18 00:44:17 +03:00
Kaloyan Chehlarski
a8103e2eb5 COMMON: Add support for multi-file InstallShield cabinets
Added support for InstallShield v6 cabinets, which can be made up of
multiple files. The interface for creating an Archive instance now takes
the base filename (e.g. the "data" in "data1.cab") for all cabinets,
including single-file ones.

Co-Authored-By: clone2727 <236052+clone2727@users.noreply.github.com>
Co-Authored-By: Walter van Niftrik <615114+waltervn@users.noreply.github.com>
2021-05-15 23:03:19 +03:00
Kaloyan Chehlarski
742edc40ec NANCY: Add detection for Russian variant of Secrets Can Kill
Added a detection entry for the Russian translation of Nancy Drew:
Secrets Can Kill.
2021-05-07 23:09:53 +03:00
Orgad Shaneh
a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Kaloyan Chehlarski
6abc61edf7 NANCY: Render text in The Vampire Diaries
Text in TVD is now rendered in the textbox, and should be
pixel-accurate to the original engine.
2021-04-29 15:59:00 +03:00
Kaloyan Chehlarski
e8a8150f8d NANCY: Fix The Vampire Diaries viewport edges and movement
The viewport edges in TVD now have the same behavior as the
original engine, and movement is now at the correct speed.
2021-04-26 19:42:17 +03:00
fracturehill
90c4f0c4dc NANCY: Move hardcoded data
Moved all hardcoded engine data that changes between games (e.g. number
of items, number of event flags) to a dedicated file and added a function for
accessing it in NancyEngine.
2021-04-24 23:59:03 +03:00
fracturehill
75d9fa1abd NANCY: Accurate viewport edge sizes
The sizes of the hotspots at the edges of the viewport are now
consistent with the original engine.
2021-04-24 23:59:03 +03:00
fracturehill
5b4b78123b NANCY: Primary video fixes
Primary video now affects the mouse the same way it does in the original game: the cursor gets moved to a set location when starting a conversation, and is blocked from moving above a certain threshold. Also removed the static pointer from PlayPrimaryVideoChan0.
2021-04-17 15:21:55 +03:00
fracturehill
864db52a09 NANCY: Implement Second Chance
Implemented Second Chance, which is the original engine's autosave system. This is disabled by default, since it replaces ScummVM's built-in autosaves.
2021-04-13 23:21:16 +03:00
fracturehill
6a07442d53 NANCY: Cheat dialogs fixes
Moved CheatDialog and EventFlagDialog to dialogs.h and removed cheat.h. Fixed a crash on closing the event flags dialog. Fixed the timer data in CheatDialog being incorrectly written to the player time. Removed a couple of incorrectly marked translation strings.
2021-04-08 21:47:15 +03:00
fracturehill
f98da95b1f NANCY: Fix doubled input between states
Fixed an issue where input would get doubled when changing states.
2021-04-08 21:42:54 +03:00
fracturehill
68e54edd50 NANCY: Initial main menu implementation
Implemented the original engine's main menu and added an option to enable it from the custom options dialog. Several buttons in the main menu don't work yet since they require implementing additional game states.
2021-04-08 21:42:54 +03:00
fracturehill
9f35d133ca NANCY: Implement sound options, add options dialog
Hooked the engine into ScummVM's speech/subtitle settings, and added two extra options for player and character speech. Added a custom settings dialog which gets shown both inside the Edit Game window and the in-game Settings.
2021-04-08 21:42:53 +03:00
fracturehill
9bb543a69e NANCY: Common sound handling changes
SoundManager is now responsible for loading and storing all common sounds (sounds with their own BOOT chunk). All playSound() calls with a hardcoded channel ID now use the chunk name instead. Also fixed some sound inaccuracies when switching between states.
2021-04-08 21:42:52 +03:00
fracturehill
36118700b9 NANCY: Fix state changing
Fixed the state system so it supports changing between two states that both get destroyed after exiting.
2021-04-08 21:42:51 +03:00
Cameron Cawley
b35e75fdeb NANCY: Fix compilation 2021-04-05 15:42:57 +01:00
fracturehill
d2d4ca9d35 NANCY: Remove nonexistent BOOT chunks
Removed FR, LG, and OB from the boot chunks list inside NancyEngine::bootGameEngine() since such chunks don't actually exist.
2021-04-01 21:25:33 +03:00
fracturehill
85f8bf294d NANCY: Includes cleanup
Reordered and cleaned up #includes in the engine.
2021-04-01 21:25:32 +03:00
fracturehill
57cd69b9c0 NANCY: Call correct cheat menu
Fixed an issue where the incorrect cheat menu would get called.
2021-04-01 21:25:31 +03:00
Cameron Cawley
4b5eefb731 NANCY: Update the console code 2021-03-28 21:36:15 +03:00
fracturehill
ff078328bc NANCY: Includes cleanup
Cleaned up the engine's #includes. Also moved the NancyEngine::GameState enum to commontypes.h and renamed it to NancyState.
2021-03-26 01:17:07 +02:00
fracturehill
b175c5fd10 NANCY: Initialize class members
Class members that get properly initialized after the constructor now also get default values during construction to silence warnings. Also fixed a couple of broken entries in response.cpp that were uncovered by these changes.
2021-03-25 19:52:53 +02:00
fracturehill
700f60042e NANCY: Fix memory leak
The CursorManager now gets deleted in NancyEngine's destructor, fixing a memory leak.
2021-03-25 19:52:51 +02:00
Filippos Karapetis
880eb17b11 NANCY: Remove duplicate chunk 2021-03-25 00:05:22 +02:00
Filippos Karapetis
ef594c7e10 NANCY: Refactor persistent sound loading, and add some nancy2 chunks
Now, persistent sounds which do not exist will not be loaded. This allows
nancy2 to progress a bit further now - it now crashes when attempting to
initialize the inventory
2021-03-24 23:26:57 +02:00
fracturehill
56c005ef2c NANCY: Mark functions and iterators as const
Added the const keyword to several auto & iterators inside for loops, as well as to a number of class member functions.
2021-03-24 17:20:46 +01:00
fracturehill
0c5b6a0244 NANCY: Formatting fixes
Fixed a couple of else statements that were not following the formatting conventions and a double semicolon in recordtypes.cpp.
2021-03-24 17:20:46 +01:00
fracturehill
86e656f709 NANCY: Remove static members of SliderPuzzle
Moved the static members of SliderPuzzle that were used to save the puzzle's state to a struct inside Scene. Removed the SliderPuzzle::synchronize() function and incorporated its logic into Scene::synchronize(). Also fixed a possible use of uninitialized variables inside the synchronization code.
2021-03-24 17:20:46 +01:00
fracturehill
a2efd6e867 NANCY: Formatting fixes
Added a missing newline at the end of telephone.cpp, removed an unnecessary newline in nancy.cpp, and corrected a couple of end of namespace comments.
2021-03-24 17:20:46 +01:00
fracturehill
e9adea4c4e NANCY: Formatting fixes
Almost every file in the engine code was using spaces instead of tabs, which is now fixed. Also added some missing spaces in a couple of files.
2021-03-24 17:20:46 +01:00
fracturehill
6728c96e68 NANCY: Add underscore to class member names
Fixed many instances of class member names not beginning with an underscore.
2021-03-24 17:20:46 +01:00
fracturehill
a286a287f2 NANCY: Replace NanEngine macro
Replaced the nonstandard NanEngine macro with a proper pointer to the current NancyEngine instance.
2021-03-24 17:20:46 +01:00
fracturehill
e324adf05f NANCY: Code cleanup
Did some cleanup of the engine, mostly focusing on the NancyEngine class. Reordered several classes' members, removed unused functions, edited comments, and renamed arfactory_v1.cpp to arfactory.cpp.
2021-03-24 17:20:46 +01:00
fracturehill
b3d06c327e NANCY: Add savefile version checks
Savefiles are now versioned (breaking previously made saves). Right now the savefile version is global across all supported games, but this will probably change as more games are added.
2021-03-24 17:20:46 +01:00
fracturehill
b7cdb2ee91 NANCY: Implement loading saves from launcher
Reordered some of the engine and scene boot code and implemented loading directly from the launcher.
2021-03-24 17:20:46 +01:00
fracturehill
ba6a973d4f NANCY: Destroy Scene state on exit
The Scene state is a singleton, which means it needs to be manually destroyed on exit, or else it will stay in memory after returning to launcher.
2021-03-24 17:20:46 +01:00
fracturehill
3910d87c82 NANCY: Load correct first scene in The Vampire Diaries
The correct first scene is now getting read from The Vampire Diaries' boot summary.
2021-03-24 17:20:46 +01:00
fracturehill
5440559918 NANCY: Add support for 8-bit color
Added generic methods for getting the pixel format and transparent color. Also added a method for loading an image directly into a ManagedSurface, which also loads the palette and lets The Vampire Diaries logo display properly.
2021-03-24 17:20:46 +01:00
fracturehill
a0c6166076 NANCY: Remove unused subclass
Remove the unused NancyEngine_v0 subclass that was erroneously left over when refactoring the code.
2021-03-24 17:20:46 +01:00
fracturehill
b34fcec89a NANCY: Add loading images from .bmp files
Added code that allows The Vampire Diaries to load its image resources, which are stored in separate .bmp files. However, they are in a different pixel format than the ones from later games, so they don't yet display correctly on screen.
2021-03-24 17:20:46 +01:00
fracturehill
b3222b7439 NANCY: Resource manager improvements
The resource manager now keeps track of its cif trees and calls to loadImage() and loadData() don't need to specify a cif tree. In order to support The Vampire Diaries, IFFs can now be loaded from their own dedicated .iff file, and the engine doesn't require a cif tree to be loaded on boot.
2021-03-24 17:20:46 +01:00
fracturehill
bde7db15ae NANCY: Use serializer when reading boot summary
Changed the readBootSummary function so it uses a serializer with the game type enum as its version. With this change, we don't need separate subclasses just to read every different BSUM format, so all of the NancyEngine child classes have been removed.
2021-03-24 17:20:46 +01:00
fracturehill
20f432f8d3 NANCY: Engine refactor
Made all states (Scene, Credits, Help, etc.) singletons, as well as subclasses of a common State parent with a proper state switching API. Moved the OnPause virtual function from RenderObject to ActionRecord and hooked it into the state switching code. Also got rid of the NancyEngine pointer that got passed around between most classes, and replaced it with several convenience macros. As a result of these changes action records that render to the viewport no longer disappear after opening the menu, and state changes feel snappier.
2021-03-24 17:20:46 +01:00