Commit Graph
48 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
Le Philousophe 1c2d757dbd NANCY: Migrate engine to Path 2023-12-24 13:19:25 +01: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 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 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 846bee430b NANCY: Correctly handle calling the GMM in all states
All game states now correctly handle calling the GMM, pausing and
unpausing sound and video as needed.
2023-04-06 18:17:17 +03:00
Kaloyan Chehlarski e2109499bd NANCY: Fix missing underscore in class member name 2023-03-30 20:21:46 +03:00
Kaloyan Chehlarski e696064615 NANCY: Implement struct for MAP chunk 2023-03-30 20:21:37 +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 13b2e82b6c NANCY: Disable mouse input while cursor is invisible 2023-03-26 11:44:05 +03:00
Kaloyan Chehlarski 5127a513fc NANCY: Set correct event flag trigger for TVD map 2023-03-26 11:44:00 +03:00
Kaloyan Chehlarski b0c7e3f4c1 NANCY: Clean up TODOs 2023-03-22 20:07:37 +02:00
Kaloyan Chehlarski 1dea184830 NANCY: Fix map video looping
Fixed the looping of the map video so the last frame doesn't get played
for double the time it should.
2023-03-22 20:07:36 +02:00
Eugene Sandulenko 83ecd17b8c NANCY: Comment out unused variable 2023-03-17 16:58:44 +01:00
Kaloyan Chehlarski fed8207725 NANCY: Map improvements
The Map state no longer reads its data from disk every time it needs to
be opened. The Vampire Diaries scenes where the map music keeps
playing are now respected.
2023-03-15 18:25:04 +02:00
Kaloyan Chehlarski 4069c5e381 NANCY: Correctly implement changing palettes
Scenes with multiple palettes will now use the correct palette,
instead of defaulting to the first one.
2023-03-15 18:25:02 +02:00
Kaloyan Chehlarski 9988b3ba43 NANCY: Implement map in The Vampire Diaries 2023-03-15 18:25:01 +02: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 26adf70cbd NANCY: Make _screenPosition a protected member
Made _screenPosition a protected member of RenderObject to force
usage of moveTo() and avoid any potential issues with the rendering
system.
2023-03-01 18:35:59 +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
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01: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 533f8aebf2 NANCY: Correctly implement map labels
The map label's position is now properly calculated instead of being hardcoded. Added the (closed) label that shows up when hovering a disabled location on the map.
2021-04-15 15:12:00 +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 c9b2e4473d NANCY: Button fixes
Changed the Button class so it doesn't require subclassing. Added a visible button to the Help screen. Also moved several classes' constructors to fix compilation errors.
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 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 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 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 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 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 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 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 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 89ea3ec0cf NANCY: Add map button
Implemented the button on the map screen that returns the player to the last scene, as well as the secret button in the same position that teleports the player to the map from select few scenes.
2021-03-24 17:20:46 +01:00
fracturehill 1773522233 NANCY: Fix nancy1 night map locations
Fixed an issue where the night map in nancy1 would load in the wrong scene, blocking the player from reaching the end sequence.
2021-03-24 17:20:46 +01:00
fracturehill f5ec222c95 NANCY: Fix sound channel clashes
Added functions that directly take a SoundDescription object and only execute if its name isn't NO SOUND. This fixes the elevator in nancy1 taking too long to start.
2021-03-24 17:20:46 +01:00
fracturehill d64a309fb3 NANCY: Small code refactor
Renamed and moved a few struct definitions to commontypes.h, added some convenience functions to Scene and removed a couple of unused variables.
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
fracturehill c73ea1b0cb NANCY: Viewport movement fixes
Added code so viewport edges do not get highlighted in directions the player can't go in.
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