Commit Graph
65 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
Paul Gilbert baccbedf50 GRAPHICS: Changed surface classes sizes from uint16 to int16 2021-07-04 18:24:27 -07:00
Eugene Sandulenko 57517dbe21 NANCY: Fix MSVC warning 2021-07-01 01:35:58 +02:00
Kaloyan Chehlarski 8760d9b54c NANCY: Better fix for broken text lines in The Vampire Diaries
The check for broken text lines has been improved and now fixes at least one more bad string in The Vampire Diaries.
2021-05-18 00:44:19 +03: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 de43aa79c1 NANCY: Disable sticky cursor in The Vampire Diaries
TVD doesn't have a sticky cursor when clicking the viewport edges,
and the feature is now disabled for that game.
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
Orgad Shaneh a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Kaloyan Chehlarski 6abc61edf7 NANCY: Render text in The Vampire Diaries
Text in TVD is now rendered in the textbox, and should be
pixel-accurate to the original engine.
2021-04-29 15:59:00 +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 ae1016e5c2 NANCY: Set correct maximum scroll in The Vampire Diaries
The maximum scroll in TVD is now corrected by one pixel, which
fixes some issues in single-frame scenes.
2021-04-26 19:42:18 +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
Kaloyan Chehlarski 954954a85a NANCY: Flip all backgrounds in The Vampire Diaries
Both format 1 and 2 backgrounds in The Vampire Diaries are
upside-down, and the Viewport code now correctly flips all
backgrounds for that game.
2021-04-26 19:42:17 +03:00
Kaloyan Chehlarski e8a8150f8d NANCY: Fix The Vampire Diaries viewport edges and movement
The viewport edges in TVD now have the same behavior as the
original engine, and movement is now at the correct speed.
2021-04-26 19:42:17 +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 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 54d6de7b57 NANCY: Make text rendering pixel-perfect
Made changes to the Textbox and Font classes so the text rendering in nancy1 looks exactly the same as it does in the original engine.
2021-04-17 15:09:18 +03:00
fracturehill 29cf663f45 NANCY: Fix primary video flicker when moving with keyboard
Removed the flicker that occurs when the player presses one of the movement keys during dialogue scenes.
2021-04-17 14:57:21 +03:00
fracturehill c88b02a3c7 NANCY: Add sticky cursor when moving viewport
The cursor now sticks to the same position when moving the viewport, making movement easier and mimicking the original engine's behavior.
2021-04-17 14:57:21 +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 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 5a7a2d8086 NANCY: Fix off-by-one drawing errors
Changed the readRect() method so it correctly adds one more pixel to the width and height. Fixed a couple of off-by-one errors in the viewport scrolling code. Set the menu and help buttons as transparent to avoid drawing green lines when they're pressed.
2021-04-13 23:21:16 +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 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 cd7f9be183 NANCY: Add video load checks
Added checks after calling loadFile() on a video decoder.
2021-03-25 19:52:51 +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 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 56c005ef2c NANCY: Mark functions and iterators as const
Added the const keyword to several auto & iterators inside for loops, as well as to a number of class member functions.
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 6be4617e26 NANCY: Make Textbox::getInnerHeight() const
Textbox::getInnerHeight() makes no changes to its class so it has now been properly marked as const.
2021-03-24 17:20:46 +01:00
fracturehill b6df945ae1 NANCY: Formatting fixes
Fixed a couple of poorly indented lines and a missing newline at the end of a file.
2021-03-24 17:20:46 +01:00
fracturehill a7373264f2 NANCY: Pass string arguments by reference
Fixed a couple instances of string function arguments not being passed by reference.
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 653239aa26 NANCY: Clip viewport-relative objects
RenderObjects marked as viewport-relative are now constrained within the bounds of the viewport
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 f24cc5ee24 NANCY: Add method for loading a palette from external file
Added the loadSurfacePalette() method to GraphicsManager, which loads a palette from an external .bmp file.
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 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 4eace74d48 NANCY: Add 8-bit color game flag for The Vampire Diaries
Added a new NancyGameFlags enum and an entry marking The Vampire Diaries' usage of 8-bit color.
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