Commit Graph

50 Commits

Author SHA1 Message Date
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
779e22f4a8 NANCY: Implement LightningOn action record type
Implemented the LightningOn ActionRecord, which changes the
color palette to simulate a lightning flash at randomized intervals.
2023-03-07 21:19:21 +02:00
Kaloyan Chehlarski
900e4666c0 NANCY: Upgrade debug console
Added several new console commands and made changes to
existing ones in preparation of the removal of the Cheat dialogs.
2023-03-03 17:35:58 +02:00
Kaloyan Chehlarski
ffaaf500b1 NANCY: Allow drawing to screen with arbitrary scale
Changed the drawing system so it will apply arbitrary scaling between
the source surface and screen destination.
2023-03-01 18:35:58 +02:00
Kaloyan Chehlarski
7c99dbc8cc NANCY: Fix broken filtering of dirty rects
Fixed the algorithm for filtering out redundant dirty rects in
GraphicsManager::draw().
2023-03-01 18:35:58 +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
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
Paul Gilbert
baccbedf50 GRAPHICS: Changed surface classes sizes from uint16 to int16 2021-07-04 18:24:27 -07: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
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
fracturehill
85f8bf294d NANCY: Includes cleanup
Reordered and cleaned up #includes in the engine.
2021-04-01 21:25:32 +03:00
fracturehill
97b4ef1301 NANCY: Fix console commands
Fixed the play_video and show_image console commands, which were using the wrong pixel format and drawing broken colors.
2021-04-01 21:25:31 +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
c846247909 NANCY: Fix viewport glitch
Fixed a rare glitch where the viewport would get cleared with a solid color when changing the frame.
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
bcd011eb79 NANCY: Reduce calls to getBasePtr() when resizing surface
Replaced most calls to getBasePtr() inside GraphicsManager::copyToManaged() with simpler pointer arithmetic to make it less costly when copying double size images.
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
a16c9b90ae NANCY: Clean up graphics loop
Removed some leftovers from an older version of the graphics manager and made the drawing code only loop once through all render objects instead of twice.
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
6eb5be2c51 NANCY: Action record reading changes
Action records are no longer expected to return how much data they've read, which will be helpful with supporting different versions in the same class. Also added a much more helpful error message on a bad read.
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
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
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
6a4e1ecb8e NANCY: Implement repeating action records
Implemented the finishExecution function, which allows some action records with the correct execType to restart after they've been triggered. Since this can result in objects getting added to the graphics manager twice, also added checks to the addObject function to avoid duplicates.
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
46ed7dce87 NANCY: Fix show_image and play_video debug commands
Added code to make the show_image and play_video debug commands play nice with the new graphics manager.
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
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
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
fracturehill
673bfec209 NANCY: Initial dialogue implementation
Implemented most of the PlayPrimaryVideoChan0 action record, which is used in all dialogue and the intro cutscene. For now the audio and video are out of sync, the scrollbar doesn't work, and the mouse isn't constrained.
2021-03-24 17:20:46 +01:00
fracturehill
fb2a65a8e7 NANCY: Initial inventory implementation
Added an initial implementation of the inventory, letting the player pick up and hold items. Interaction between items and the viewport is still TODO.
2021-03-24 17:20:46 +01:00
fracturehill
d5b7053dbe NANCY: Add scrollbar movement and inventory contents
Added code to move the two scrollbars and implemented renderFrameInvBox(), which displays the inventory. Actually populating the inventory and interacting with it are still TODO.
2021-03-24 17:20:46 +01:00
fracturehill
6ce4390b93 NANCY: Add map location labels and button
Added the place names that appear when hovering a location on the map screen and the button to return to the last scene. Also made some minor improvements to the input manager.
2021-03-24 17:20:46 +01:00
fracturehill
9152deeac7 NANCY: Implement map
Implemented the map state, as well as the two main action record types that call it. Also made some minor related changes to the scene and graphics managers.
2021-03-24 17:20:46 +01:00
fracturehill
b642ca3b4d NANCY: Implement secondary movie
Implemented the PlaySecondaryMovie action record, which is used in some death scenes. Also made some minor changes to a few other action records and the sound manager.
2021-03-24 17:20:46 +01:00
fracturehill
2a6555fe36 NANCY: Partially implement bitmap animations
Implemented PlayIntStaticBitmapAnimation, which allows the teacher's room PC screensaver to display properly. This impementation skips the sound component, which will be added later if needed.
2021-03-24 17:20:46 +01:00
fracturehill
46341dde11 NANCY: Implement secondary video
Implemented the two SecondaryVideo channels, allowing the game to display NPC animations outside of dialogue. The implementation repeats some frames and plays at the wrong speed so further work is needed.
2021-03-24 17:20:46 +01:00
fracturehill
8397e35212 NANCY: Display UI sliders
Added code to show the sliders for the text and inventory boxes and made them hoverable. Interacting with them is still TODO.
2021-03-24 17:20:46 +01:00
fracturehill
c18e0b171d NANCY: Add initial mouse support
Implemented a simple mouse with the ability to change the cursor bitmap. Also changed the View struct to use Rects instead of separate properties for every coordinate.
2021-03-24 17:20:46 +01:00
fracturehill
b79d9f1a32 NANCY: Rendering code refactor
Several small changes to the rendering code that reduce code complexity, most notably the removal of the game's dirty rectangle optimizations.
2021-03-24 17:20:46 +01:00
fracturehill
d97ca12d6c NANCY: Initial commit 2021-03-24 17:20:46 +01:00