Commit Graph
45 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 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 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 57c9f5f203 NANCY: Implement EnableDisableInventory
Implemented an action record type responsible for making
a specific item temporarily unusable.
2023-10-03 17:58:28 +03:00
Kaloyan Chehlarski b0bd3f1c3f NANCY: Implement viewable items in nancy7
Added support for the new type of item introduced in nancy7,
which, instead of getting picked up, transports the player to
a new scene with a close-up view of the item.
2023-10-03 17:58:28 +03:00
Kaloyan Chehlarski f22326d4a7 NANCY: Fix inventory box scrolling
Fixed an off-by-one error when calculating the inventory
box, which would result in some items getting their top
few pixels clipped when the inventory has grown
sufficiently full
2023-09-29 15:13:43 +03:00
Kaloyan Chehlarski 6f0e74c620 NANCY: Play correct sfx when getting/losing item 2023-09-12 19:43: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
Eugene Sandulenko f94464ecb1 NANCY: JANITORIAL: Remove trailing spaces 2023-08-07 10:47:50 +02: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 8ca65cea3b NANCY: Implement item highlighting
Added code to highlight items when they're hovered inside
the inventory box.
2023-04-14 22:39:09 +03:00
Kaloyan Chehlarski 732181653f NANCY: Correct inventory box size
Corrected the inventory box size so it doesn't overlap the frame in
The Vampire Diaries.
2023-04-06 18:17:14 +03:00
Kaloyan Chehlarski 29d1819b97 NANCY: Keep curtains visible in The Vampire Diaries 2023-04-06 18:17:14 +03:00
Kaloyan Chehlarski 5d49712a47 NANCY: Disable inventory box interaction during dialogue
The inventory box no longer accepts mouse input when there is an
active primary video.
2023-04-02 22:33:42 +03:00
Kaloyan Chehlarski e0f74000ef NANCY: Implement structs for some BOOT chunks
Boot chunks BSUM, VIEW, INV, and TBOX are now read only at startup,
and their data is kept permanently inside NancyEngine. This removes the
need for the chunks to be read by multiple classes and always kept
in memory.
2023-03-30 20:21:36 +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 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 5908e0b2d4 NANCY: Add facilities to load nancy.dat
Added functions for loading the data inside nancy.dat. Removed
constants.h and .cpp.
2023-03-03 17:35:57 +02:00
Kaloyan Chehlarski 78df65e416 NANCY: Simplify and improve graphics code
Rewrote GraphicsManager::draw() to be simpler and more correct,
eliminating the need for RenderObjects to know what they're
overlapping at creation.  This comes at the cost of slightly increased
redraw, but that can be reduced fairly easily if needed.
2023-02-25 19:37:23 +02:00
Cameron Cawley 3e019c1d94 NANCY: Simplify palette code 2023-02-08 00:09:39 +01:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01: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 2a8512925a NANCY: Fix items and inventory box in The Vampire Diaries
Items now show up in TVD's inventory box, and displaying their
cursor in the viewport no longer crashes the game.
2021-04-26 19:42:18 +03:00
fracturehill 8b8d3b38de NANCY: Fix curtains in The Vampire Diaries
Fixed the visual artifacts in the inventory box curtains in The Vampire
Diaries. Renamed the Shades class to Curtains to reflect their name in
the original engine.
2021-04-24 23:59:03 +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 a29cdd43c0 NANCY: Make RenderObject non-abstract
Made RenderObject non-abstract so it can be used in some simple cases without the need for subclassing.
2021-04-15 15:12:00 +03:00
fracturehill f255542672 NANCY: Scrollbar fixes
Changed the UI::Scrollbar class so it doesn't require subclassing and added functionality for horizontal scrollbars. Fixed the textbox and inventory box scrollbars so their lowest point is consistent with the original engine's.
2021-04-15 15:11:59 +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 85f8bf294d NANCY: Includes cleanup
Reordered and cleaned up #includes in the engine.
2021-04-01 21:25:32 +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 1907b5f741 NANCY: Remove static members of GraphicsManager
Made GraphicsManager's static members non-static.
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 54bdb420b0 NANCY: String reading fixes
Added a \0 to every instance of a char buffer being loaded into a Common::String. Fixed an instance of a large buffer getting repeatedly allocated and deleted inside a for loop. Fixed an instance of a small char buffer being unnecessarily allocated on the heap. Also added a readFilename() convenience function to util.h for reading 8-character filenames found in the data.
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 7220797ca4 NANCY: Remove redundancy in transparency handling
Removed the BlitType enum and getBlitType() method from RenderObject, and replaced them with setTransparent(). This was done to reduce redundant code, since ManagedSurface can already pick between a transparent and regular blit depending on whether the provided source surface has a transparent color set. Also added the correct transparent color for The Vampire Diaries, and the transparent color for nancy1 now gets calculated on the fly.
2021-03-24 17:20:46 +01:00
fracturehill 8fccf950fe NANCY: Initialize additional surfaces with screen format
Changed surfaces in the textbox and inventory box so they are now initialized with the screen pixel format instead of the one used inside images. With this change The Vampire Diaries no longer fails a particular assert in the ManagedSurface blitting code, and can now boot successfully.
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 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 7c8e0aea3d NANCY: Properly clean up when starting new game
The engine now properly cleans up the inventory items and hints so they don't carry over when the player restarts the game (e.g on win/lose).
2021-03-24 17:20:46 +01:00
fracturehill cb373ff04e NANCY: Add missing UI sfx
Added some missing sound effects when clicking on various UI elements.
2021-03-24 17:20:46 +01:00
fracturehill 725ff2f95d NANCY: Implement inventory scrollbar
Implemented scrolling of the inventory through the scrollbar.
2021-03-24 17:20:46 +01:00
fracturehill 3aaf2a9bea NANCY: Major engine rewrite
Rewrote most of the engine using a much more object-oriented approach and using more of ScummVM's common classes. This design deviates quite a lot from the original engine's, but should be more maintainable and extensible in the future.
2021-03-24 17:20:46 +01:00