Commit Graph
53 Commits
Author SHA1 Message Date
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01: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
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
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 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 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 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 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 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 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 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 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
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 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 55fe1a5db4 NANCY: Implement credits and WinGame action record
Implemented the WinGame action record, which allows the player to reach the credits after winning, as well as the Credits state itself. Also made some minor changes to Scene and Nancy to accommodate for the addition.
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 a96fcd78db NANCY: Fix infinite hints
Fixed an issue where used hints would not get subtracted from the maximum amount allowed per playthrough, allowing for infinite hints.
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 5f35b8abcb NANCY: Implement help screen and UI buttons
The menu and help buttons on the sides of the frame are now functional, and the help screen is now also accessible. Also replaced the Frame class with a more general FullScreenImage that will be used across different game states.
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 145d5fd735 NANCY: Add ActionRecord and Scene debug channels
Added debug channels for action records and scenes, and added proper output to their respective loading functions.
2021-03-24 17:20:46 +01:00
fracturehill c8dbb03b89 NANCY: Fix segfault on exit
Fixed an issue where RenderObjects would get registered twice in the graphics manager and sometimes cause a segmentation fault when closing the interpreter.
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 67f11d9c91 NANCY: Scene improvements and fixes
Added functionality for the hint system, and added const qualifiers to functions that don't change the scene's state
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 05ac9934c7 NANCY: Global main menu support
Added proper support for the GMM, so videos will not fast-forward on resume and timers will not include the time spent outside the game.
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