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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Replaced most calls to getBasePtr() inside GraphicsManager::copyToManaged() with simpler pointer arithmetic to make it less costly when copying double size images.
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.
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.
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.
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.
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.
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.
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.