Commit Graph
358 Commits
Author SHA1 Message Date
BunnyBun fc7d5ff613 DIRECTOR: Dump decompiled scripts along with bytecode
TODO: The script ids currently do not match those of bytecode
2025-04-19 12:12:32 +02:00
BunnyBun ae46e89879 DIRECTOR: Dump decompiled lingo scripts 2025-04-19 12:08:46 +02:00
Eugene Sandulenko 20d9525c88 DIRECTOR: Load more fields from CastInfo and dump their context (noisily) 2025-02-21 12:59:29 +01:00
Scott Percival 50193e4365 DIRECTOR: Add support for RichTextCastMember 2025-02-17 11:07:59 +01:00
Scott Percival 7b0934135f DIRECTOR: Add FilmLoopCastMember loader for D5 2025-02-08 14:45:53 +01:00
Scott Percival 7362ec3cb1 DIRECTOR: Fix libResourceID usage for multiple casts 2025-02-04 15:24:17 +01:00
Scott Percival c4bd70d820 DIRECTOR: Fix name remapping when duplicating a cast member
Fixes the language icons on the remote control in Murphy's TV.
2025-02-04 15:24:17 +01:00
Scott Percival 39c252e993 DIRECTOR: Fix multiplexed cast member ID handling
In D5, the castNum will return a multiplexed ID instead of just the
member ID, and various other features will accept and use the
multiplexed ID.

Fixes the story playback and basic navigation in Smarty.
2025-02-04 15:24:17 +01:00
Le Philousophe d297c94982 DIRECTOR: Fix UB when calculating checksum
The constant contained an extraneous F which is removed.
In addition, mark it as unsigned to avoid undefined behaviours while
manipulating too large constants.
2025-01-24 23:37:04 +01:00
Roland van Laar 6edd735c6c DIRECTOR: Implement RTECastMember duplication
Implement support for `RTECastMember` in `duplicateCastMember`.
Adds a constructor on `RTECastMember` for duplication.

Resolves a crash in the Safecracker menu where the error was:

	Uncaught Lingo error: No match found for cast member
2025-01-03 17:42:32 +01:00
Scott Percival c6d6785447 DIRECTOR: Fix loading Lingo scripts from different internal casts
Fixes the block minigame in Fisher Price Learning in Toyland.
2024-11-11 20:40:06 +01:00
Roland van Laar b1a1be521e DIRECTOR: show amount bytes unread in loadCastData
Show the amount of bytes that are not read when loading a castmember
in `loadCastData`.
2024-10-18 16:59:50 +02:00
Roland van Laar a41f0c4cb8 DIRECTOR: Add BUILDBOT error on cast read < stream
BUILDBOT will now error when reading a castmember
and not having reached the end of the castmember
data stream.
2024-09-13 16:09:11 +02:00
Roland van Laar b2fe4cedea DIRECTOR: Improve output of BUILDBOT EOS message
Add the castType to the output of the End Of Stream BUILDBOT message.
2024-09-06 16:33:13 +02:00
Roland van Laar 916f2dabc7 DIRECTOR: Error buildbot on end of stream castread
The following was found in Director 5 when reading text casts.
The relevant part for the cast is copied from the filestream in a
MemoryReadStreamEndian. `eos` is set when more is read then is available
but it won't error out.
In this case we want a warning when this happens and an error in the
buildbot. It probably means we don't load casts right yet.
2024-08-28 15:12:06 +02:00
Eugene Sandulenko 7c1c5fc23e DIRECTOR: Decompile scripts only when the debugger is on or dump_scripts is set 2024-07-07 23:11:46 +02:00
Eugene Sandulenko ac331f291f DIRECTOR: Hid decompiled scripts print out to Compile debug channel 2024-06-05 17:16:41 +02:00
Scott Percival 49a4648f6e DIRECTOR: Force Lctx loading after other resources
It is possible for the bytecode compiler to call
getCastMemberByScriptId, which in turn can force a load() for a cast
member. If this cast member happens to be a TextCastMember, the text
will be missing.

Fixes the maze gallery minigame in Virtual Nightclub.
2024-05-22 17:24:31 +02:00
Eugene Sandulenko aa3633e10b DIRECTOR: Hid decompiled script printing under debug level 5 2024-05-18 16:09:56 +02:00
Eugene Sandulenko af5a2f2d80 DIRECTOR: Activate code decompiler
This reverts commit 5cfe752759.
2024-05-17 18:53:14 +02:00
scemino 5cfe752759 DIRECTOR: Revert code decompiler activation 2024-05-17 14:31:39 +02:00
scemino f600534707 DIRECTOR: Start to add code decompiler (WIP) 2024-05-17 14:17:41 +02:00
Eugene Sandulenko 6f1508c9ad DIRECTOR: Initial plug in of script decompiler 2024-05-16 06:34:39 +02:00
Scott Percival ed4d4e355b DIRECTOR: Fix absolute paths in linked cast members
Fixes listening to the radio in the hotel in GADGET: Invention, Travel
and Adventure.
2024-05-12 22:00:19 +02:00
Scott Percival 61d0603304 DIRECTOR: Duplicate cast member fixes
Cast bounding boxes are now copied, and duplicates of shared cast
members are kept in the (cross-movie) shared cast.

Fixes displaying the inventory bar in Virtual Nightclub.
2024-05-12 22:00:19 +02:00
Scott Percival f8210d9b58 DIRECTOR: Fix cast member name cache
In Director you can have multiple cast members with the same name.
Looking up a cast member by name should always return the first member
ID; we don't necessarily load the cast members in order, so we need
to verify this. Also any cast manipulation actions should update or
refresh the name cache.

Fixes the bitmaps chosen for the welcome cube at the start of Virtual Nightclub.
2024-05-12 22:00:19 +02:00
Scott Percival 54c6bd2636 DIRECTOR: Add framework for duplicating cast members 2024-04-25 00:54:17 +02:00
Scott Percival c49c10e881 DIRECTOR: Enable kLPPTrimGarbage for D2/D3 scripts
With D2/D3 action and movie scripts, if there is a syntax error,
the compiler seems to truncate the script at the first unreadable
character, then attempt to compile again.

Fixes the machine gun minigame in Hell Cab.
2024-04-25 00:54:17 +02:00
Scott Percival d43612db85 DIRECTOR: XOBJ: Refactor methods to pass path to library 2024-03-31 16:58:31 +02:00
Scott Percival 7daf4bde43 DIRECTOR: Fix encoding bugs in Cast::getVideoPath()
Fixes video path fetching in Director 3 movies which use MooV stubs
to link to a QuickTime filename with Japanese characters (e.g.
intelligentnote demo).

Fixes video path fetching where the directory in the castInfo ends with
a path separator (e.g. criticalpath).
2024-03-11 01:04:43 +01:00
Scott Percival 2ba42271d7 DIRECTOR: Add initial RTE loading support 2024-03-11 01:04:43 +01:00
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