Commit Graph
327 Commits
Author SHA1 Message Date
Scott Percival 0377f34e8e DIRECTOR: Revert multiple filmloop support
This reverts commit 21c08536e9.

Unfortunately most of the animations in Eastern Mind stopped working, we
need a rethink of how we do this.
2024-02-28 22:02:55 +08:00
kartiksharmakk 21c08536e9 DIRECTOR: Manage filmloop composed of other filmloops.
This patch adds support for filmloops composed of other filmloops.
It also fixes a bug in the filmloop bbox computation during Sprite::setCast() , we have to create a case kCastFilmLoop to prevent it from going to default case as the default case equates it to dims which is initialrect (0 value) , so the setCast function basically made film loop bbox 0.

Steps to reproduce:

Run the command: ./scummvm --start-movie="ATD\HD\ccTWRRAD.DXR" totaldistortion-win.
After running the command, the fish will now be visible. Previously, it was not being displayed due to lack of nested film loop support.
2024-02-12 11:06:00 +01:00
Scott Percival 03aa341d0b DIRECTOR: Add patcher for individual script handlers
This gives the ability to replace function handlers in a compiled Lingo
script with a replacement from the quirks table. The replacement can be
written in Lingo; no need to worry about injecting bytecode.

As an example, here's a replacement for Cosmology of Kyoto's text input
handler. The original was notorious for requiring an exact match against a
word list containing typos, along with extra spaces and punctuation. The
new one is more forgiving, and always supports the answers "yes" and
"no".
2024-01-30 23:30:11 +01:00
Le Philousophe cf3eac29c3 DIRECTOR: Migrate engine to Path 2023-12-24 13:19:25 +01:00
Scott Percival b167078783 DIRECTOR: Test cast resources for the correct tag before use
It is possible for cast resource IDs to overlap with non-cast ones.
The most notable example is movie resources, which are hardcoded
to resource ID 1024.

As a precaution, when loading the cast data, iterate through all of
the child resources and search for one with the expected tag.

Fixes loading text cast member 3743 when putting the lamp on the
bedside table in The Dark Eye.
2023-11-17 01:20:03 +01:00
Eugene Sandulenko cfbfd7d6c5 DIRECTOR: Print out human-readable file version 2023-08-14 01:04:30 +02:00
Eugene Sandulenko 8bccc12786 DIRECTOR: Reduce header dependency 2023-08-02 21:05:06 +02:00
Scott Percival 4cae7953c2 DIRECTOR: Add support for fetching alias path from MooV chunks
Fixes most of the videos in Wallobee Jack.
2023-07-23 14:07:20 +02:00
Scott Percival dff38babeb DIRECTOR: Fix palette loading for D2
PaletteCastMembers exist in D2, and the process for loading them is
the same as in D3. The special case in Cast::loadCast() isn't needed.

In D2 the PaletteCastMember::load() hook wasn't getting called;
we solve this by copying the load() hook to loadCastDataVWCR, which will
get called even if there are no CastInfo objects.

Fixes the colour-cycling Invictus logo in Alice: An Interactive Museum.
2023-07-19 10:52:01 +02:00
Scott Percival f4bab7a34d DIRECTOR: Add missing guardrail for Cast::loadExternalSound 2023-07-16 14:01:48 +02:00
Eugene Sandulenko 42525c54e8 DIRECTOR: Set default palette castlib properly
We were keeping CastLib -1 there, which was leading to all palettes
loaded from cast, referring to the built-in palettes

Fixes IDG Magazine
2023-07-09 23:41:36 +02:00
Scott Percival 70ffd87c62 DIRECTOR: Add guardrails to loadSampleSounds 2023-07-08 22:01:00 +03:00
Eugene Sandulenko a62b7985b5 DIRECTOR: Modernized some loops 2023-06-29 17:35:06 +02:00
Harishankar Kumar dbfb410054 DIRECTOR: Support fonts loading from resource-fork
This drops the _castArchive->hasResource() check that was placed
before loading 'FOND' resource type.

Fixes texts fonts for 'theapartment-4' where 'shared.dir' has
'DecoText' font in the resource-fork.
2023-06-21 20:18:39 +03:00
Eugene Sandulenko 96c36bb004 DIRECTOR: Remove VWtc/VWtk warnings. These chunks are not used 2023-06-12 15:49:45 +02:00
Scott Percival 14474ce129 DIRECTOR: Fix "the number of castMembers"
This figure is supposed to be the highest member ID for a cast member in
the current movie, not the actual count of cast members.

In addition, Lingo only throws an error when querying cast member IDs that
are higher than this figure. If the member ID is lower and the cast
member doesn't exist, "the" queries return a VOID.

Fixes the verify cast table check in Star Trek TNG Episode Guide.
2023-06-08 09:16:30 +02:00
Scott Percival 458e97933d DIRECTOR: Refactor archive loading code
Make DirectorEngine::_allOpenResFiles the de-facto owner of Archive *
objects, move all of the various loadEXE/loadMac methods off Window and
onto DirectorEngine, and replace inline Archive loading with
openArchive().
2023-06-08 09:16:30 +02:00
Misty De Meo 0c92428a0f DIRECTOR: Cast: search for xlib
The shared cast can contain xlibs. Fixes recognizing the xlib in
Journey to the Source.
2023-06-01 11:37:42 +08: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 343a177016 DIRECTOR: Add new lookup table for D5 palette fade times
When fading a palette, Director lets you pick a "frame rate" between 1
and 30. These each correspond to a fixed transition time, with the
higher framerates converging to zero.

In D4 and under the slowest of these frame rates is half a second.
After some user feedback they changed this in D5 to be a range
of times, ranging from a leisurely 16.5 seconds all the way to
instantaneous.

Fixes the intro fade in The Cute machine.
2023-05-10 22:32:21 +02:00
Scott Percival 2065a7d39c DIRECTOR: Fix D5 looping sound support
Fixes the intro fadeout of The Cute machine.
2023-05-10 22:32:21 +02:00
Vladimir Serbinenko 36f3797f02 DIRECTOR: Accept DRCF as config instead if VWCF 2023-05-10 09:53:36 +02:00
Scott Percival 8976c4f56b DIRECTOR: Fix parse bug in loadCastlibMapping 2023-05-10 09:48:50 +02:00
Scott Percival 919b7ff5b1 DIRECTOR: Show multiple casts in debugger 2023-05-10 09:48:50 +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 8a990d556c DIRECTOR: Add Transition cast member type 2023-05-10 09:48:50 +02:00
Scott Percival 0a3b7ee462 DIRECTOR: Load in external casts and members 2023-05-10 09:48:50 +02:00
Scott Percival 2009f27712 DIRECTOR: Add D5 support for _defaultPalette 2023-05-10 09:48:50 +02:00
Scott Percival 699e50cf7d DIRECTOR: Buffer recursive load() requests 2023-05-10 09:48:50 +02:00
Scott Percival 3b13e8ff43 DIRECTOR: Support D5 loading multiple casts
In D5 and up, you can have multiple casts in the same movie, along with
external casts. Unlike shared casts these are different namespaces;
each movie maps the casts to a libId, which is then used by
CastMemberID.castLib.

For D4 and below, the default cast libId is now represented by
DEFAULT_CAST_LIB. This should make refactoring easier in future.
2023-05-10 09:48:50 +02:00
Eugene Sandulenko bb2b4b37ba DIRECTOR: JANITORIAL: Consistently refer to Director versions as D[number] in the comments 2023-04-29 14:22:27 +02:00
Scott Percival 4557c52258 DIRECTOR: Lazily load cast member data from archive
Required for e.g. Inscape games, where movie files contain more data
than could (at the time) fit into RAM. Removes a noticable wait when
switching movie files.
2023-04-29 14:20:05 +02:00
Scott Percival 1fd0692f6b DIRECTOR: Move load operations inside cast member 2023-04-29 14:20:05 +02:00
Scott Percival e289ea5896 DIRECTOR: Remove shared cast check from Cast::loadBitmapData()
This is a holdover from the original code, where the cast members
were loaded as part of the Score. Cast is now per-movie, so all the
resources should be in the one place.
2023-04-29 14:20:05 +02:00
Scott Percival f703ee6ecf DIRECTOR: Split CastMember classes into files 2023-04-29 14:20:05 +02:00
Scott Percival ef3d360552 DIRECTOR: Unify arguments to Cast::loadXData functions 2023-04-29 14:20:05 +02:00
Scott Percival 7b8fee4599 DIRECTOR: Add stubs for V5 cast library info loader 2023-04-29 14:20:05 +02:00
Scott Percival 459115fb78 DIRECTOR: Fix castInfo loading for D5 2023-04-29 14:20:05 +02:00
Scott Percival 88ba80555a DIRECTOR: Add initial support for film loops in D3 2023-04-29 14:20:05 +02:00
Eugene Sandulenko e5b11f18a2 DIRECTOR: Do not want about SCRF and VWtk chunks, since we do not need them 2023-03-26 22:40:31 +02:00
Einar Johan Trøan Sømåen 9e0df0a896 DIRECTOR: Properly delete the ImageDecoder in loadBitmapData 2023-03-26 22:31:06 +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 95f6d7a227 DIRECTOR: Improve handling of external bitmap palettes
When loading bitmap cast members from a file, Director will keep an
copy of what palette the image uses. However the order of colours in
the image's own palette can be completely different!

It appears that at load time, Director will remap all of the colours in
the image to match the order in the palette cast member. As such, we can
force a remapping for those external cast members using the existing
dither code.

Fixes the colours in Cat The Ripper.
2023-03-24 21:27:34 +01:00
Scott Percival 156cb87a33 DIRECTOR: Fix linked bitmap cast members
The Director editor supports importing images from a variety of image
formats, which it then converts. There is also the option for linked
bitmap cast members (i.e. using image files on the disk), which have a
much more restricted subset of formats. As of Director 4, this list
includes Windows Bitmap files, and anything supported by the Apple
Picture Viewer (i.e. any possible encoding of PICT, and JPEG images).

File extensions are ignored, so we use some basic magic number checking to
determine which ImageDecoder class to use.

Fixes viewing the manifesto pages in DEVO Presents: Adventures of the
Smart Patrol.
2023-03-24 21:27:34 +01:00
Scott Percival 6db1f878ef DIRECTOR: Add cast action scripts to debug output 2023-03-24 21:27:34 +01:00
Scott Percival 6bd69381f0 DIRECTOR: Fix palette ID mapping for D3
The CLUT in the resource fork can contain palettes unused by Director;
the key is that all of the ones used for cast members have a palette ID
of the cast ID + 1024. This is effectively what the D2 branch was
relying on, so we can clean up the logic and use it for D3 as well.

Fixes the Invictus logo in Over-Ring-Under, the colour cycling in The 7
Colors, and countless others.
2023-03-06 21:26:28 +01:00
Scott Percival bbce11c7ed DIRECTOR: Add support for palettes in Macintosh color table format 2023-03-06 21:26:28 +01:00
Scott Percival 82e891d1d3 DIRECTOR: Move palette/transition debugging to images flag 2023-03-06 21:26:28 +01:00
Scott Percival 570bbfb7f1 DIRECTOR: Add "info" command to debugger 2023-03-06 21:26:28 +01:00
Eugene Sandulenko c9a3397ee3 DIRECTOR: Plug memory leak 2023-02-24 19:39:10 +01:00