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.