Commit Graph
50 Commits
Author SHA1 Message Date
Kaloyan Chehlarski b1a861b50d NANCY: JANITORIAL: Fix trailing whitespace/tabs 2024-02-19 20:46:17 +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 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 999048d0d2 NANCY: Ensure cursor is drawn after launcher load
Fixed an issue where, if a save is loaded through the
ScummVM launcher, the cursor would only become visible
the first time it changes, e.g. when the player moves it
outside the viewport.
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
Kaloyan Chehlarski 76132f19e3 NANCY: Reduce calls to replaceCursor()
The game cursor was previously being replaced on every
frame; now, we only replace it when a new one is needed.
2023-11-21 01:05:48 +02:00
Kaloyan Chehlarski 1bc3940e6b NANCY: Cursor fixes
With the adjustments made to the regular cursor, the
inactive zone during conversations was rendered a few
pixels shorter than it should be; now the cursor can be moved
up right up to the edge of the viewport.

Also, when entering a conversation, the mouse cursor would previously warp immediately, but its graphic would only change
a frame later; this has also been fixed
2023-10-28 16:19:34 +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 ddc5378d80 NANCY: Simplify cursor logic and explain CURS structure 2023-10-03 17:58:28 +03:00
Kaloyan Chehlarski 03c780c4cd NANCY: Support nancy6 scene flags
Added support for two scene flags introduced in nancy6; one
disables the auto-move functionality on a per-scene basis,
and the other replaces the regular rotation cursors with
the newly-introduced inverted rotation ones.
2023-09-21 14:46:16 +03:00
Kaloyan Chehlarski 9f0904e8a3 NANCY: Make rotation cursors a special case
Added the 'rotate (counter)clockwise' cursor types used in
some puzzles to the list of special cases that override
inventory cursors.
2023-09-21 14:46:16 +03:00
Kaloyan Chehlarski 30d9732d20 NANCY: Cursor fixes
The forward and backward arrow cursors seem to have
been forgotten until now, so they have been implemented.
Also, the HotMultiframeSceneChange variants with specific
cursors now actually display those cursors.
2023-09-20 16:16:22 +03:00
Kaloyan Chehlarski 896f90929a NANCY: Fix cursor hotspots in nancy6
Added a heuristic for figuring out the number of cursor
types in every game.  This removes the need for a massive
switch statement for every game title, and fixes an issue
in nancy6 where hotspots would be wildly incorrect.
2023-09-19 17:38:23 +03:00
Kaloyan Chehlarski 555de022cb NANCY: Support nancy6 cursors 2023-09-16 13:14:52 +03:00
Kaloyan Chehlarski da0238d91b NANCY: Use correct exit cursor in nancy4 puzzles
Nancy4 started using the backwards arrow cursor for
puzzles' exit hotspots, which is now correctly implemented.
2023-09-12 19:43:30 +03:00
Kaloyan Chehlarski d520b0c8db NANCY: Fix arrow cursor hotspot
Added a manual fix for the Nancy games' awful hotspot
position for the arrow cursor.
2023-09-02 17:24:39 +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 686d9da082 NANCY: Add support for nancy4 cursors
Added support for the up/down/forward/backward cursors
introduced in nancy4. This also fixes the previously broken
arrow cursors.
2023-08-08 12:13:05 +03:00
Eugene Sandulenko f94464ecb1 NANCY: JANITORIAL: Remove trailing spaces 2023-08-07 10:47:50 +02:00
Miro Kropacek f85fde7707 ENGINES: ALL: Use new CursorMan API where applicable
This makes code not only cleaner but also friendly to 8-bit surfaces
where pitch != width.
2023-07-19 22:22:11 +02:00
Kaloyan Chehlarski f03ff22074 NANCY: Show arrow cursors when turning viewport
Also made the code in CursorManager::setCursor much
more readable.
2023-05-12 12:42:32 +03:00
Kaloyan Chehlarski 55847e0827 NANCY: Actually fix cursors in nancy3
Fixed the number of cursor types in nancy3 so it's 8
instead of 9.
2023-05-12 12:42:31 +03:00
Kaloyan Chehlarski 2fc98c4542 NANCY: Correctly handle nancy3 cursors
Nancy3 added several new cursor types, which are now
loaded correctly.
2023-05-11 14:28:54 +03:00
Kaloyan Chehlarski 4d9bde82dd NANCY: Avoid cursor flashing when changing scene
Added code to suppress draw calls and cursor changes.
This makes it so there are no single-frame discrepancies
between when the cursor is changed and when the scene is.
2023-04-16 15:40:50 +03:00
Kaloyan Chehlarski 26289fc947 NANCY: Fix cursors in nancy2
The CURS chunk is now read correctly in nancy2, and cursor IDs
have been adjusted to account for the additional cursor type that's
introduced from that game onward.
2023-04-02 22:33:42 +03:00
Kaloyan Chehlarski 74ee83c9e1 NANCY: Change cursor data loading
Made CursorManager::init() take the CURS chunk as an argument,
and changed it so it's more readable.
2023-03-30 20:21:39 +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 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
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 805d7615a0 NANCY: Show correct exit cursor
In TVD the exit cursor gets replaced when holding an item, whereas
nancy1 always shows it. This commit makes both games follow their
respective correct behavior.
2021-05-07 23:09:52 +03:00
Orgad Shaneh a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Kaloyan Chehlarski 3dd19a47e1 NANCY: Set correct cursor when hovering a UI element
Set the correct ID for the cursor that displays when hovering a
clickable UI element.
2021-04-29 15:59:00 +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 c86d46fcde NANCY: Fix The Vampire Diaries's cursors
Fixed the cursors in The Vampire Diaries so they display correctly.
2021-04-24 23:59:03 +03:00
fracturehill 43c4c62f40 NANCY: Cursor fixes
When exiting a scene while holding an item, the cursor shown is now the fourth version of the item cursor, just as it is in the original engine. When entering a scene through the map while holding an item, the cursor no longer gets reset to the default one.
2021-04-17 15:20:59 +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 bfc6586f78 NANCY: Add reserve() calls before initializing arrays
Added calls to reserve() before initializing most arrays in the engine to reduce unnecessary allocations when pushing back elements one by one.
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 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 0fdda6fbfc NANCY: Code formatting fixes
Fixed a lot of code formatting issues, including switch case statements being indented, some curly braces not being left hanging, if and for statements not being surrounded by newlines, some double spaces, and more.
2021-03-24 17:20:46 +01:00
fracturehill 3611184261 NANCY: Fix leaked surfaces
Fixed a few instances of surfaces not getting freed after use.
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