Commit Graph

4878 Commits

Author SHA1 Message Date
Eugene Sandulenko
d0b5529e15
DIRECTOR: Added stub for parent scripts 2023-05-13 17:38:00 +02:00
Eugene Sandulenko
1ff6b25465
DIRECTOR: LINGO: Implement "the number of castlibs" 2023-05-13 15:57:48 +02:00
Eugene Sandulenko
57b57ec7a1
DIRECTOR: LINGO: Implement "the number of xtras" 2023-05-13 15:42:09 +02:00
Vladimir Serbinenko
18d740fedd DIRECTOR: Redo "Fix use-after-free"
This reverts commit 036297b605.
Then it solves the same problem in a way that is more compliant
with how similar code is written in this engine thus avioding
accidentally introduced memory leak.
2023-05-12 00:11:58 +02:00
Eugene Sandulenko
c66b66664b
DIRECTOR: Force all transitions to single step in fast mode 2023-05-10 23:32:24 +02:00
Scott Percival
a379602443 DIRECTOR: Hide null calls to Movie::getScriptContext() 2023-05-10 22:32:21 +02:00
Scott Percival
e49e64345b DIRECTOR: Make BitmapCastMember::_bitsPerPixel a uint8
Fixes several bitmaps in The Cute machine.
2023-05-10 22:32:21 +02:00
Scott Percival
3b5500227a DIRECTOR: Update the current sound fade during a palette transition
Fixes the intro music fading in The Cute machine.
2023-05-10 22:32:21 +02:00
Scott Percival
e0c7bec488 DIRECTOR: Fade sounds if the channel handle exists
isChannelActive() excludes looping sounds, which are allowed to
be faded in or out.

Fixes the intro music fading in The Cute machine.
2023-05-10 22:32:21 +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
Scott Percival
401a17d35a DIRECTOR: Add dynamic sound channel allocation
By D5, titles are allowed to play back sounds on an arbitrary channel
and the mixer deals with it. This apparently works to an extent on Mac
for D4 and below, whereas Windows D4 has a hard limit of 4 channels.

As the clear intent is to play something, we should do that for all
versions, unless a counterexample shows up.

Used by Smarty.
2023-05-10 22:32:21 +02:00
Scott Percival
093fbae86c DIRECTOR: Add detection entry for "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
Vladimir Serbinenko
b8207b5f08 DIRECTOR: Ignore Xtra files 2023-05-10 09:53:36 +02:00
Vladimir Serbinenko
036297b605 DIRECTOR: Fix use-after-free 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
5426729bf4 DIRECTOR: Fix zoom transitions 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
5c82519e35 DIRECTOR: Add D5 support for sound cast members 2023-05-10 09:48:50 +02:00
Scott Percival
96855f1cf7 DIRECTOR: Add D5 file extensions to pathMakeRelative 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
b26a6f304f DIRECTOR: Add version cutoff for cast member loaders 2023-05-10 09:48:50 +02:00
Scott Percival
a439d0c790 DIRECTOR: XOBJ: Add QTVR stubs 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
49f38f28de DIRECTOR: Add new kClutSystemWinD5 palette 2023-05-10 09:48:50 +02:00
Scott Percival
75e5885eb9 DIRECTOR: LINGO: Make patcher use DEFAULT_CAST_LIB 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
Vladimir Serbinenko
04c22afb00 DIRECTOR: Correct spelling mistake pointed out by kane159 2023-05-07 02:39:39 +02:00
Walter Agazzi
b4a336e312 DIRECTOR: Add detection entries for two titles
TRAC reports 14432/14440
2023-05-05 18:05:07 +02:00
Eugene Sandulenko
b62757d138
DIRECTOR: LINGO: Remove unused variable 2023-04-29 14:25:03 +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
8cb29bd921 DIRECTOR: LINGO: Add special override mechanics for List builtins
Fixes the loader in Star Trek TNG Episode Guide
2023-04-29 14:20:05 +02:00
Scott Percival
2730ccc7ed DIRECTOR: LINGO: Make arithmetic issues invoke lingoError() 2023-04-29 14:20:05 +02:00
Scott Percival
14af094515 DIRECTOR: XOBJ: Replace stub boilerplate with macro 2023-04-29 14:20:05 +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
8ff91ce024 DIRECTOR: LINGO: Make b_getNthFileNameInFolder always check cache
It's possible for games to request files that don't exist in the game
path, e.g. C:\WINDOWS\TX2SAVES. As such, the method needs to always
include the quirk files, regardless of whether the path exists.

Fixes loading save games in Operation: Eco-Nightmare
2023-04-29 14:20:05 +02:00
Scott Percival
4e1b32c0d4 DIRECTOR: Add filesystem quirk for teamxtreme2 2023-04-29 14:20:05 +02:00
Scott Percival
a407f165a6 DIRECTOR: XOBJ: Remove directory from fileio paths
Jamming an absolute Windows path into a filename is allowed on Linux,
however Windows isn't as forgiving.

It would be nice to preserve the full path of the saved file;
unfortunately the SaveFileManager API doesn't support subdirectories.
For now just keep the old pattern of [gameid]-[filename].txt.

Fixes save games in Operation: Eco-Nightmare
2023-04-29 14:20:05 +02:00
Scott Percival
f4cbadaca2 DIRECTOR: XOBJ: FindSys must return a path with a slash 2023-04-29 14:20:05 +02:00
Scott Percival
9ff4641c68 DIRECTOR: LINGO: Add RECT support to getObjectProp
Fixes starting a new game in Operation: Eco-Nightmare
2023-04-29 14:20:05 +02:00
Scott Percival
f0343d6f02 DIRECTOR: Add stubs for BatQT XObj 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