Commit Graph
70 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
Kaloyan Chehlarski 482da55d33 NANCY: Fix drawing of MouseLightPuzzle
Previously, the record worked based on the assumption that
its background will be completely black. This is not the
case in several nancy7 scenes. To support it, an additional
4-byte ARGB pixel format is now allowed in the engine, since
we need to be able to set an alpha value for the surface.
2024-02-06 20:32:27 +01:00
Le Philousophe 1c2d757dbd NANCY: Migrate engine to Path 2023-12-24 13:19:25 +01:00
Kaloyan Chehlarski f552277520 NANCY: Slightly optimize drawing
Reduced some of the overdraw in GraphicsManager::draw();
testing suggests a speedup of roughly 9%
2023-11-21 01:05:49 +02: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 3a72322d55 NANCY: Ensure objects' last position is cleared
Added a safeguard against an issue that could pop up
when moveTo() is called multiple times between draws.
2023-10-07 14:45:22 +03:00
Kaloyan Chehlarski 67d36e46b7 NANCY: Add support for nancy7 special effects
The SpecialEffect action record got some significant changes
in nancy7, including a new type of fade, and the removal
of the predefined number of frames to fade. Testing with the
original is tough, since it runs way too fast on modern PCs,
and the new fade type is never actually used properly, so
the current implementation is only an approximation. Also,
I've discovered that prior to these changes the entire screen
got crossfaded, so the screenshotViewport() function is now
entirely removed.
2023-10-07 14:45:22 +03:00
Kaloyan Chehlarski 73c6d2087d NANCY: Avoid immediate crash when an error is thrown
Fixed an edge case where an error being thrown during
the very first time a Scene is loaded would result in a
chain reaction that would crash ScummVM while trying to
draw invalid data on screen. Instead, the error is now
properly shown on screen before quitting.
Also made changes to the savegame screenshot code to make
sure this change does not impact second chance saves.
2023-09-19 17:38:24 +03:00
Kaloyan Chehlarski e35722f382 NANCY: Improve BSUM reading
Added several missing fields in the BSUM chunk, and
used their values in relevant code. Also fixed an issue
in nancy6 which would make viewport movement slow.
2023-09-19 17:38:24 +03:00
Kaloyan Chehlarski edf03037a2 NANCY: Properly clear deleted RenderObjects from screen
Added code that makes sure that when a RenderObject is removed from GraphicsManager's internal list, its graphics
do not stay on screen.
2023-09-14 22:54:17 +03:00
Kaloyan Chehlarski a62f7cd7d7 NANCY: Implement TangramPuzzle
Implemented the puzzle type responsible for nancy3's tile
fitting puzzle.
2023-09-02 17:24:39 +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
Kaloyan Chehlarski f25b6e42a7 NANCY: Implement original load/save menu 2023-08-28 19:53:33 +03:00
Kaloyan Chehlarski 4c5d0d2299 NANCY: Silence warnings
Fixed several small issues that caused compiler and/or
Coverity warnings.
2023-08-24 12:47:50 +03:00
elasota 2beab37b0e NANCY: Fix signed/unsigned conversion 2023-07-08 22:02:00 +03:00
Kaloyan Chehlarski 9d18181318 NANCY: Implement SpecialEffect
Implemented the SpecialEffect action record, which
handles crossfading between scenes and fades to black.
2023-04-20 18:00:23 +03:00
Kaloyan Chehlarski 471bcccfe4 NANCY: Implement RippedLetterPuzzle
Implemented the RippedLetterPuzzle action record,
which has the player rearrange torn pieces of a letter.
Added the kRotate cursor type. Added a custom function
for rotating a surface by a right angle.
2023-04-16 15:40:51 +03:00
Kaloyan Chehlarski 4d9bde82dd NANCY: Avoid cursor flashing when changing scene
Added code to suppress draw calls and cursor changes.
This makes it so there are no single-frame discrepancies
between when the cursor is changed and when the scene is.
2023-04-16 15:40:50 +03:00
Kaloyan Chehlarski cbe958db0c NANCY: Change font loading
Changed the font loading code so it doesn't need to call getBootChunk().
2023-03-30 20:21:43 +03:00
Kaloyan Chehlarski 7abdf5c126 NANCY: Add list of image chunks 2023-03-30 20:21:42 +03: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 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