Commit Graph
72 Commits
Author SHA1 Message Date
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh ee57380de7 ENGINES: JANITORIAL: Remove 'virtual' when override is specified 2021-11-14 14:32:04 +02: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 a0600328c1 NANCY: Fix some sounds not playing when changing scene
Fixed an issue where some sounds would play and immediately get
stopped when changing the scene.
2021-05-18 00:44:18 +03:00
Kaloyan Chehlarski 9ede2f3c91 NANCY: Fix single frame with wrong palette in The Vampire Diaries
Fixed an issue where the screen would render with an incorrect
palette once before switching to the correct one in TVD.
2021-05-07 23:09:52 +03:00
Kaloyan Chehlarski 913f4502a6 NANCY: Implement palette change action record types
Implemented the PaletteThisScene and PaletteNextScene action record
types, which change the viewport video's palette in TVD.
2021-05-07 23:09:52 +03:00
Kaloyan Chehlarski 3013d07e81 NANCY: Implement PlaySoundPanFrameAnchorAndDie action record
Implemented the PlaySoundPanFrameAnchorAndDie action record
type and added support for panning audio to the sound manager.
2021-05-07 23:09:51 +03:00
Orgad Shaneh a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Kaloyan Chehlarski 46e7231628 NANCY: Implement non-wrapping scenes
Implemented scenes that don't wrap around when they go beyond
the first/last frame of the video.
2021-04-29 15:58:59 +03:00
Kaloyan Chehlarski b87f98602e NANCY: Correct logo skip timing in The Vampire Diaries
Added a new logoEndAfter game constant, which controls how long
the game logo will stay on screen after booting the game, and
extracted its value for The Vampire Diaries.
2021-04-28 17:02:59 +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 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 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 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 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 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 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 b029d377ab NANCY: Fix credits transparency
Fixed an issue where the credits text's background was bright green instead of transparent.
2021-03-25 19:52:53 +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 a00cea8e2c NANCY: Replace default destructor in State
Replaced the defaulted destructor in State::State with empty braces since the default was getting marked as noexcept and was causing build errors.
2021-03-24 21:25:04 +02:00
fracturehill 0d8d31ffd0 NANCY: Formatting fixes
Added spaces after the = operator in every declaration of a pure virtual or defaulted function.
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 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 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 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 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 da559b5fe0 NANCY: Display The Vampire Diaries video correctly
The Vampire Diaries' videos are all upside down after decompression, need a palette to be loaded from a separate bitmap file, and background videos are also quarter size (1/2 width and height). This commit adds a GraphicsManager function for loading a Surface or a raw buffer into a ManagedSurface, applying all transformations needed to display it correctly.
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 8468071ca2 NANCY: Load video palette from scene summary
Added support for The Vampire Diaries' scene summary format, which contains the name of a dummy bitmap file with an embedded palette.
2021-03-24 17:20:46 +01:00
fracturehill d16876272a NANCY: Load hints only when a HINT chunk exists
Fixed a crash in The Vampire Diaries caused by trying to access a nonexistent HINT chunk.
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 2d757175b0 NANCY: Fix msvc compile errors
Fixed some compile errors msvc was throwing when synchronizing Time objects without casting them to uint32 first.
2021-03-24 17:20:46 +01:00
fracturehill a6f2b172f3 NANCY: Hook Logo state to the graphics manager
The logo state now uses a FullScreenImage object instead of blitting directly to the 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
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 7fcdeb641c NANCY: Time fixes
Got rid of the useless tickCount variable and made sure the total play time gets adjusted after switching back to Scene from another state.
2021-03-24 17:20:46 +01:00