Commit Graph
67 Commits
Author SHA1 Message Date
Kaloyan Chehlarski f0ba64cc08 NANCY: Add ciftree_export console command 2023-10-26 19:46:32 +03: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 cb526a5eb3 NANCY: Fix kSceneCount dependency
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.
2023-10-03 17:58: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 eca40b5401 NANCY: Remove irrelevant output in console command
Removed a debug text line which must've been the result
of an incorrect copy-paste.
2023-10-01 13:20:34 +03:00
Kaloyan Chehlarski 0a4b4415e0 NANCY: Fix Coverity issues 2023-09-25 14:37:37 +03:00
Kaloyan Chehlarski c20f765032 NANCY: Add console command to display hotspots 2023-09-24 17:43:28 +03:00
Kaloyan Chehlarski 839486c452 NANCY: Improve scan_ar_type console command
Added an optional parameter to scan_ar_type to allow
for scanning in scenes other than the current one.
2023-09-19 17:38:25 +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 d98daea902 NANCY: Add export_image console command 2023-08-28 19:53:31 +03:00
Kaloyan Chehlarski 452e259281 NANCY: Implement kRandom dependency type
Implemented the random dependency type, which evaluates
to true or false based on random chance.
2023-08-24 12:47:50 +03:00
Thierry Crozat 5b35830ea1 NANCY: Fix 'expected unqualified-id' compilation error
'or', 'and', and 'not' are keywords in C++ (they are alternatives
to ||, && and ! respectively) and thus should not be used as
variable names.
2023-08-22 23:31:17 +01:00
Kaloyan Chehlarski 2deb31503a NANCY: Add sound_info console command
Added a console command that displays info about
currently playing channels.
2023-08-22 21:08:17 +03:00
Kaloyan Chehlarski 860f5cd090 NANCY: Add 3D sound support
Added support for 3D sound, as introduced in nancy3.
The original engine used DirectSound 3D, which enabled
for easy sound panning, attenuation based on distance,
and doppler effect simulation. The DS3D algorithm
has only been approximated; in particular, there are some
minor differences when it comes to sound panning.
2023-08-22 12:15:26 +03:00
Kaloyan Chehlarski a6e5c8c83a NANCY: Implement nancy3 object use flags
nancy3 changed the way the kKeepAlways inventory flag
worked, and added a third flag with the old behavior. As
a result of this change, the suitcase key in nancy3 no longer
disappears after being used.
2023-08-11 01:02:10 +03:00
Kaloyan Chehlarski 45efd63044 NANCY: Upgrade scan_ar_type console command
The scan_ar_type command can now scan for specific bytes
inside an action record's raw data.
2023-08-11 00:08:57 +03:00
Kaloyan Chehlarski f932ef8c13 NANCY: Fix crash in list_actionrecords command
Fixed an issue where the list_actionrecords console command
may crash the engine when a dependency exists on the
very first event flag.
2023-08-08 12:13:06 +03:00
Kaloyan Chehlarski 5cb1c716cc NANCY: Update list_actionrecords console command
Added missing dependency types to the list_actionrecords
console command, and made sure it respects the recursive
nature of dependencies in nancy3 and above. Fixed a crash
due to the event flag numbering being changed in nancy3.
Fixed a typo in the function name.
2023-07-13 18:13:56 +03:00
Kaloyan Chehlarski eda2ee947c NANCY: Fix use-then-lose items
Items marked as single-use are now correctly removed from
the inventory. Also extended the get_inventory console
command to show if an item is single-use or not.
2023-07-13 14:32:46 +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 130209f89d NANCY: Implement nancy3 dependency tree
Nancy3 introduced the kOpenParenthesis and
kCloseParenthesis dependency types, which allow for
more complicated dependency logic. This commit changes
the structure of the DependencyRecord type to support
parent-child relationships similar to the ones found
inside the original implementation's code. Also introduced
is the static canHaveHotspot() function in ActionRecord,
which is used to correctly implement cursor dependencies.
2023-05-10 16:57:32 +03:00
Kaloyan Chehlarski d2d65ffb28 NANCY: Make arfactory.cpp more readable
Replaced the hexadecimal ActionRecord typeIDs and replaced
them with the ones found inside gameflow.h. Also updated
the scan_ar_type console command to match.
2023-04-13 21:20:35 +03:00
Kaloyan Chehlarski 9717f13650 NANCY: Update nancy.dat reading 2023-04-02 22:33:42 +03:00
Kaloyan Chehlarski 504cec69b9 NANCY: Add chunk_export debug command 2023-03-30 20:21:34 +03:00
Kaloyan Chehlarski 3749b21f18 NANCY: Formatting fixes
Changed spaces to tabs, fixed some double spaces and cleaned up
trailing whitespaces.
2023-03-07 21:19:24 +02:00
Kaloyan Chehlarski 1fa1de39b6 NANCY: Rename action record dependency types
Renamed the dependency types for ActionRecords to match their
official ones. Also added the dependency types found in nancy3.
2023-03-07 21:19:22 +02:00
Kaloyan Chehlarski 87b375f4f1 NANCY: Retire NancyFlag
Removed the NancyFlag enum and replaced it with more specific
constants.
2023-03-05 16:31:25 +02:00
Kaloyan Chehlarski 49dd99a7b1 NANCY: Modify scan_ar_type to only look inside scenes
Changed the scan_ar_type debug command to only look inside
scene chunks, preventing errors when used with nancy2 and above.
2023-03-05 16:31:24 +02:00
Kaloyan Chehlarski fa2c22ddf1 NANCY: Add console command to scan for ActionRecords
Added the scan_ar_type console command, which scans every
available IFF for an ActionRecord of the given type.
2023-03-05 16:31:23 +02:00
Kaloyan Chehlarski 4f744f44b8 NANCY: Print cif_list debug command in columns 2023-03-05 16:31:23 +02:00
Kaloyan Chehlarski 900e4666c0 NANCY: Upgrade debug console
Added several new console commands and made changes to
existing ones in preparation of the removal of the Cheat dialogs.
2023-03-03 17:35:58 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh 3a51911db2 NANCY: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02: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
fracturehill 85f8bf294d NANCY: Includes cleanup
Reordered and cleaned up #includes in the engine.
2021-04-01 21:25:32 +03:00
fracturehill 97b4ef1301 NANCY: Fix console commands
Fixed the play_video and show_image console commands, which were using the wrong pixel format and drawing broken colors.
2021-04-01 21:25:31 +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 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 b6df945ae1 NANCY: Formatting fixes
Fixed a couple of poorly indented lines and a missing newline at the end of a file.
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 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 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
fracturehill a752f1a4f2 NANCY: Initial save/load support
Added initial support for savestates. The format will most likely change with future commits, but I will only start versioning once the engine supports more than a single game. To support proper serialization the Scene state has had its kInit state split into kInit and kInitStatic, InventoryBox had some of its code reordered, and members of several classes have had their types changed.
2021-03-24 17:20:46 +01:00
fracturehill 5c1843f871 NANCY: Rename state functions in nancy.h
Renamed all functions relating to the engine's internal state so they only mention the word State instead of GameState. This is to avoid confusion between them and functions relating to savegames, whose names already include GameState.
2021-03-24 17:20:46 +01:00
fracturehill 7d93c7996e NANCY: Clear input after exiting console
Fixed an issue where the input manager would still think the player was pressing ctrl even after closing the debug console.
2021-03-24 17:20:46 +01:00
fracturehill 46ed7dce87 NANCY: Fix show_image and play_video debug commands
Added code to make the show_image and play_video debug commands play nice with the new graphics manager.
2021-03-24 17:20:46 +01:00
fracturehill 20d226fc10 NANCY: Fix load_scene and scene_id console commands
Fixed an issue where load_scene and scene_id would incorrectly complain about being in the wrong game state.
2021-03-24 17:20:46 +01:00
fracturehill e4890a18fc NANCY: Sound manager improvements
The original engine stores sound information in at least four different types of structs, all of which can now be loaded and played back. Also implemented sound types, which will be configurable from the ScummVM interface, added the correct number of sound channels, and implemented sound fx in a couple of action record types.
2021-03-24 17:20:46 +01:00