Commit Graph
113 Commits
Author SHA1 Message Date
Scott Percival 2f8426016c DIRECTOR: Add gamma correction for Mac games 2025-03-25 12:17:34 +08:00
Le Philousophe 2a37e2b808 GRAPHICS: MACGUI: Implement drawing primitives
This makes the code comply with the latest API changes.
The drawing calls now need to be optimized for the complex shapes.
2025-01-24 12:11:17 +01:00
D G Turner de5bdcd904 DIRECTOR: Fix GCC Compiler Warnings 2025-01-12 17:16:42 +00:00
Cameron Cawley 0b9055abf0 DIRECTOR: Migrate to the new Primitives class 2025-01-08 18:36:55 +02:00
Cameron Cawley 8b3cf445d5 DIRECTOR: Make more static data read only 2024-11-26 00:32:00 +01:00
Scott Percival f5b9dda781 DIRECTOR: Fix detection of builtin palettes 2024-06-24 22:34:30 +08:00
Scott Percival 554b9a9987 DIRECTOR: Validate all palette cast member IDs before use
Fixes the avalanche of error messages when entering the mirror
in AMBER: Journeys Beyond.
2024-06-22 15:07:37 +08:00
Krish e9ab5f5ee3 DIRECTOR: Fix reverse ink not rendering as expected
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
2024-06-03 14:01:15 +02:00
Scott Percival bde3fe3f77 DIRECTOR: Reset palette in use on movie switch
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.
2024-05-28 16:43:43 +08:00
Scott Percival 45c9abff93 DIRECTOR: Refactor Channel::getMask()
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.
2024-05-12 22:00:19 +02:00
Matthew Jimenez 5219c99400 GRAPHICS: Move PaletteManager definition to a separate header 2024-03-12 12:24:00 +02:00
Scott Percival 1ac78ddf44 DIRECTOR: Add fast path for kInkTypeCopy 2023-11-25 02:03:38 +01:00
Scott Percival ccff1f8655 DIRECTOR: Rework BITDDecoder to store the original data
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.
2023-11-11 22:58:43 +01:00
Eugene Sandulenko c9a1586f42 DIRECTOR: Added more debug output for palette loading 2023-07-09 23:41:35 +02:00
Scott Percival 9ec6722b6a DIRECTOR: Remove inkBlitStretchSurface()
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.
2023-05-28 14:44:09 +02:00
Scott Percival da06ecad9b DIRECTOR: Move _lastPalette to DirectorEngine
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.
2023-05-14 14:10:22 +02:00
Scott Percival ec76e5dfc6 DIRECTOR: Refactor palette loading for D5
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.
2023-05-10 09:48:50 +02:00
Scott Percival 49f38f28de DIRECTOR: Add new kClutSystemWinD5 palette 2023-05-10 09:48:50 +02:00
Scott Percival f703ee6ecf DIRECTOR: Split CastMember classes into files 2023-04-29 14:20:05 +02:00
Einar Johan Trøan Sømåen c3b1baf906 DIRECTOR: Refactor BitmapCastMember to store a Picture instead of decoder
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.
2023-03-26 19:11:46 +02:00
Scott Percival bdb555d9a0 DIRECTOR: Fix kInkTypeAdd, kInkTypeAddPin, kInkTypeSub and kInkTypeSubPin 2023-03-16 14:46:18 +01:00
Scott Percival 3cb61c54d7 DIRECTOR: Fix kInkTypeBlend, remove redundant _blend field on Sprite 2023-03-16 14:46:18 +01:00
Scott Percival 81cc30f8e4 DIRECTOR: Fix kInkTypeTransparent, kInkTypeNotTrans, kInkTypeGhost and kInkTypeNotGhost 2023-03-16 14:46:18 +01:00
Eugene Sandulenko 1aa37ba545 DIRECTOR: Simplified and renamed castType2str() 2023-02-13 16:24:46 +01:00
Scott Percival c5095c0e62 DIRECTOR: Fix several blend modes
Blend modes have been confirmed with visual inspection of a test card.

Fixes the end screens in Yaken Rodem.
2023-01-10 13:41:53 +01:00
Scott Percival 9fb41d82d1 DIRECTOR: Add support for displaying 2-bit and 4-bit bitmaps 2023-01-10 13:41:53 +01:00
Scott Percival 48740a2ad1 DIRECTOR: Remove all palette reversing workarounds
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.
2023-01-10 13:41:53 +01:00
Scott Percival 93262a99fb DIRECTOR: Add memory guardrails for inkBlitSurface 2022-11-18 16:28:05 +01:00
Scott Percival 1524ee3615 DIRECTOR: Fix coloring of 1-bit bitmaps
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.
2022-11-18 16:28:05 +01:00
Scott Percival 076423de8a DIRECTOR: Implement color cycling 2022-09-12 15:52:18 +02:00
Scott Percival 756cfdd27d DIRECTOR: Make DirectorEngine copy palettes on use
This is going to be the basis for the palette-cycling effects.
2022-09-12 15:52:18 +02:00
Scott Percival 671d3116ea DIRECTOR: Add palette shifting code for transitions
Fixes transitions in Lost Mind of Dr. Brain demo.
2022-09-12 15:52:18 +02:00
Pragyansh Chaturvedi 842fe20c5e DIRECTOR: Modify decomposeColor to fix missing text in buttons in 32bpp mode 2022-09-09 02:21:47 +02:00
D G Turner 739af389f0 DIRECTOR: Fix Signed vs. Unsigned Comparison GCC Compiler Warning 2022-08-29 01:57:17 +01:00
Scott Percival ef03dbb92e DIRECTOR: Fix rendering for kInkTypeBackgndTrans and kInkTypeCopy
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.
2022-08-28 10:31:00 +00:00
Eugene Sandulenko dbb1114269 DIRECTOR: Switch to wider rect primitives so visuals stay unchanged 2022-07-13 23:22:35 +02:00
Eugene Sandulenko 38a1cb9963 DIRECTOR: Fix outlined QD sprites with pattern tiles 2022-06-17 01:07:14 +02:00
Eugene Sandulenko f92f51b3e4 DIRECTOR: Fix thickness when drawing tiled QD shapes 2022-06-16 23:40:45 +02:00
Eugene Sandulenko 1e082af6f8 DIRECTOR: Attempt to fix tile pattern origin. Still incorrect 2022-06-15 18:23:06 +02:00
Eugene Sandulenko 131138b9a7 DIRECTOR: Fix drawing outlined QD shapes, patterns were missing 2022-06-15 18:23:05 +02:00
Eugene Sandulenko c5b8d31f16 DIRECTOR: Implement tile pattern drawing. Not yet referenced. 2022-06-15 01:01:05 +02:00
Eugene Sandulenko b7735a6326 DIRECTOR: Encapsulated tile access and implement override by VWTL 2022-06-15 01:01:05 +02:00
Eugene Sandulenko 43b1306bcd DIRECTOR: Simplify builtin tiles decompressing 2022-06-14 01:03:02 +02:00
Eugene Sandulenko aa34532742 DIRECTOR: Added built-in tile drawing to tests 2022-06-13 18:12:22 +02:00
Eugene Sandulenko 43a71055f5 DIRECTOR: Decompress built-in tiles 2022-06-13 18:12:22 +02:00
Eugene Sandulenko c95d4245dc DIRECTOR: Simplify DirectorPlotData 2022-06-13 18:12:22 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Scott Percival 29973e8627 DIRECTOR: Revert change to inkBlitShape
Using the dest. rect for everything leaves snail trails
in most of Spaceship Warlock.
2021-10-12 08:19:29 +08:00
Scott Percival 8b240f69b8 DIRECTOR: Fix inkBlitShape to use destRect for drawing 2021-10-12 01:08:34 +08:00
Scott Percival 257fd958e7 DIRECTOR: Add blitting code to FilmLoopCastMember 2021-10-12 01:08:34 +08:00