This fix ensures elements using reverse ink are now rendered correctly. Seen in many places in The Apartment (any version).
Test movies were created, to test all inks in 1bpp.
./scummmvm --start-movie=1bpp-inktest-1/2 director-tests
The reverse ink is 5th in the first column
Previously if there was a movie switch, and the two movies used
different custom palettes with the same cast ID, there was no
mechanism to force a swap to the new palette.
Fixes palette glitches in Die Hexenakademie.
The Mask ink type allows Director to combine a sprite with a 1bpp
mask bitmap to stencil an image. Previously we were using the widget
drawing code to generate this image, which caused issues with scaling
and depth (as the surface was formatted to match the screen). The new
code checks for a 1bpp image specifically and sends it through, removing
the workarounds for screen depth.
Fixes the drawing of the welcome cube at the start of Virtual Nightclub.
Previously, BITD bitmaps were pre-converted to match the ScummVM colour
depth. This caused issues in 32-bit mode; you are allowed to change the
palette of an 8-bit image at any time, so pre-converting all 8-bit
images to 32-bit leaves you frozen to whatever palette was in use when
the image was loaded.
The correct way to deal with this is to keep the original bitmap
pixel format, and perform the conversion at widget creation time.
No longer needed, the scaling should happen when updating the widget.
Fixes adjusting sprites with Lingo, such as in DEVO Presents:
Adventures of the Smart Patrol.
If the destination movie uses a palette cast member in the same location
as the source, but with different data; Director will assume that the old
palette is correct right up until it has to switch to something else via
the score.
Additionally, ensure that all palettes are loaded into the index when
the Cast is loaded, not just single ones that haven't been loaded before.
Fixes movie transitions and palette rendering in Phibos: Following the Comet.
Previously, the palette ID namespace was shared between cast ID, builtin
ID and resource fork ID. This was quite messy.
The new approach is to use CastMemberID; builtin palettes are libId -1,
cast palettes use their respective libId, and a null CastMemberID
indicates a blank entry.
This is in preparation for allowing for Lingo to get/set the picture
of BitmapCastMember.
In particular, storing a Picture lets us easily replace the existing
image (instead of having to rely on ImageDecoder as source).
Also, having Picture instances that are easy to copy will make lifetime
management easier if pictures are copied into longer-living things such
as globals.
All of the builtin palette lookup tables have been reversed, to match
the original layout of the tables in the Director 4 projector executable.
This corresponds with the colour indexing used in Lingo.
Likewise, the code to load palettes from the cast no longer reads the
colours in reverse order, and shiftPalette no longer expects
the start index to be after the end index.
DirectorEngine::transformColor still exists to upgrade to 32-bit colour,
but no longer reverses the palette index.
The missing builtin 16-color palettes from Director 4 have been added.
If a channel contains a 1-bit bitmap cast member, use the foreground
color instead of black when rendering in Background Transparent mode.
Fixes various text bitmaps in Total Distortion and iD4 Mission Disk 1.
I don't know what scenario was used as a basis for developing the existing
applyColor logic in inkDrawPixel(). As such, I've kept it for the uint32
pathway, and replaced the uint8 pathway with the logic documented in the
Director 4 manual.