Commit Graph
265 Commits
Author SHA1 Message Date
Roland van Laar 20d2092045 DIRECTOR: Implement framerate 0x10
In Director 2 and 3 framerates are preset and referenced as: 0x0 to 0xF.
Some movies set a framerate of 0x10.

D2 and D3 interpret this as a framerate of 15.
Which was measured to be exactly the same as setting a framerate of 15.

In D4 it's shown as a framerate of 120.

Movies with a framerate of 0x10:
D2: DATA/WARLOCKSHIP/REUNION (spaceship warlock)
D4: ping.dir (chop suey)
2022-03-10 15:51:38 +01:00
Roland van Laar 9142f4454f DIRECTOR: LINGO: Fix else statement
An else statement was missing to the if. All proper framerates < 16 were
generating warnings in buildbot.
2022-03-09 18:04:24 +01:00
Roland van Laar b5fcdb561b DIRECTOR: LINGO: improve framerate handling
The framerate can be set to 1, 2 and 3 via the tempo channel.
These are the actual framerates, meaning 1 fps is 1 fps.
2022-03-09 17:35:59 +01:00
Roland van Laar 00e6cf0411 DIRECTOR: Improve framerate loading D2 and D3
D2 and D3 have 16 distinct framerates, 0x0 to 0xF.
Framerates are integer values. They are rounded down towards their
nearest integer.

The following table is included for completeness.

The information was gathered by creating a D3 movie with an `on stepMovie` handler that counts every frame.
The setting is the setting on the slider in the D3 panel.
It was timed with clicking 'play' in D3 and start on a stopwatch at the
same time. The same for stopping the movie and the stopwatch.
FPS was calculated by dividing the amount of frames given by Director
and the time on the stopwatch.

setting     time        frames      fps
3           60.18       226         3.755
4           30.04       121         4.028
4.1         30.09       131         4.354
4.2         30.29       141         4.65
5           30.38       153         5.036
5.1         30.09       165         5.483
6           30.20       182         6.026
6.1         30.06       201         6.687
7           30.04       228         7.590
8           30.24       260         8.598
10          30.15       302         10.017
12          30.16       364         12.069
15          30.17       454         15.048
20          30.10       602         20.0
30          30.05       904         30.08
60          30.07       1811        60.226
2022-03-06 21:51:56 +01:00
Roland van Laar 3caf5013a6 DIRECTOR: Handle duplicate cast names
Multiple casts can have the same name. The last encountered cast with
that name was save in a hashtable.
Director seems to use the cast that was encountered last.
This solves the problem by not writing existing cast names.

It happened in the game Louis Catorze. The name mainMenu was associated
with a TextCast but also a ScriptCast. The chunkexpression 'line 5 of
mainMenu' is not valid for a ScriptCast.
2022-01-21 12:49:53 +01:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh 02cfffcb67 DIRECTOR: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
Misty De Meo ecb2703b0d DIRECTOR: Do not error on missing BitmapCastMember resource 2021-11-09 09:24:51 +00:00
djsrv d66aff96c7 DIRECTOR: Clarify purpose of getPlatformEncoding 2021-11-08 23:44:08 -05:00
Alexandre Detiste 6044504762 JANITORIAL: typos
some in the variable names, some in the comments;
no change for the strings that interract with original games assets
2021-10-31 20:46:31 +01:00
Scott Percival 68518fc8a9 DIRECTOR: Fix default palette index 2021-10-12 01:08:34 +08:00
Scott Percival 0e0254a5f7 DIRECTOR: Fix currentFrameRate loading for v4 2021-10-12 01:08:34 +08:00
Scott Percival 0ecdd9b26f DIRECTOR: Add preliminary loader for film loops 2021-10-12 01:08:34 +08:00
Scott Percival 76d0d4ea33 DIRECTOR: Add stronger warning for unsupported cast members 2021-09-25 02:48:06 +08:00
Eugene Sandulenko f8b98e3f04 DIRECTOR: Convert script line endings on dumping 2021-08-08 18:12:13 +02:00
djsrv 1c594b903b DIRECTOR: Use Unicode version of toPrintable 2021-08-07 14:54:36 -04:00
djsrv cedc5678ac DIRECTOR: Fix loading video 2021-08-07 10:44:37 +02:00
djsrv e6c696031f DIRECTOR: Punycode dump file names 2021-08-07 10:44:37 +02:00
djsrv 9509db076b DIRECTOR: Remove FileVersion type name
File versions aren't constrained to the values in the enum, they can be
any uint16. The enum just contains major versions, and it doesn't make
much sense to treat it as an independent type.
2021-07-19 14:05:02 -04:00
djsrv 33abbcad60 DIRECTOR: Use cast file version in looping check 2021-07-19 13:55:14 -04:00
djsrv 38ca2062b8 DIRECTOR: Handle D4 differences in sound looping behavior 2021-07-19 13:38:55 -04:00
djsrv 30df98e61b DIRECTOR: Create Cast::decodeString 2021-07-15 16:31:47 -04:00
djsrv 88ea6e1645 DIRECTOR: Re-encode loaded text to UTF-8 2021-07-15 16:31:47 -04:00
djsrv ed64ec6699 DIRECTOR: Default movie/cast platform to Mac 2021-07-15 16:31:47 -04:00
ysj1173886760 f27a3c74d0 DIRECTOR: implement loading STR file 2021-07-14 18:00:49 +08:00
ysj1173886760 e4105dc091 DIRECTOR: clear the widget pointers in castmember when we are switching the movie. 2021-07-12 14:15:24 +08:00
djsrv 6cfed5099e DIRECTOR: Remove Cast::getString
This is no longer used for loading cast info.
2021-07-12 00:38:05 -04:00
ysj1173886760 c77f2e33cb DIRECTOR: amend version check in loadCast and BITD decoder 2021-07-10 14:11:19 +08:00
ysj1173886760 b6b5881d7f DIRECTOR: Add a version check for adding palette in loadCast 2021-07-09 09:41:31 +08:00
Paul Gilbert 005561d305 COMMON: Increase Stream pos, seek, size from int32 to int64 2021-07-08 18:24:28 -07:00
ysj1173886760 2ef52a07cb DIRECTOR: amend the way we are parsing palette for D2 2021-07-08 02:25:11 +02:00
djsrv 0294513802 DIRECTOR: Fix uninitialized fields 2021-07-06 23:33:09 -04:00
djsrv 644c2cdf78 DIRECTOR: Fix STXT compilation version check 2021-07-06 21:52:21 -04:00
djsrv 258318c0b1 DIRECTOR: Read movie creation platform from config 2021-07-06 21:30:30 -04:00
djsrv 745c56f0b5 DIRECTOR: Improve handling different versions in Cast::loadConfig 2021-07-06 21:30:30 -04:00
djsrv a2848f5dba DIRECTOR: Handle FXmp mappings in loadFontMapV4
The previous way I handled the FXmp mappings overcomplicated MacText.
It also resulted in behavior different from the original Director.  With
the previous implementation, if a Win movie with Arial text was opened
with the platform set to Mac, the textFont of field 1 would return
Arial, while it would return the mapped font name Helvetica in the
original. This implementation's behavior should match the original.
2021-07-06 16:47:20 -04:00
djsrv e9d9b9f569 DIRECTOR: Revert FXmp handling
This reverts commit 4dabee7e8b.
This reverts commit 3fda461d5f.
This reverts commit 831c014f9e.
This reverts commit b3b55e59e9.
2021-07-06 16:47:20 -04:00
djsrv 831c014f9e DIRECTOR: Make FXmp available to MacText 2021-07-05 22:53:35 -04:00
djsrv 39ffd5b784 DIRECTOR: Implement Fmap 2021-07-05 14:34:33 -04:00
djsrv 8e2c8ee2d4 DIRECTOR: Map fonts in FontStyle::read
The previous place I was mapping the font IDs didn't catch everything,
breaking text with more than one style.
2021-07-04 10:07:27 -04:00
djsrv 4aaf2d3dbb DIRECTOR: Parse FXmp chunk 2021-07-04 00:27:51 -04:00
djsrv d4882d2daa DIRECTOR: Move loadFontMap to fonts.cpp
There is going to be quite a bit of code to handle font mapping, so I've
created a new file for it.
2021-07-04 00:25:38 -04:00
djsrv 957abce35b DIRECTOR: Initialize cast and movie version in constructors
Just set it to 0 to inicate no archive is loaded instead of garbage.
2021-07-04 00:25:38 -04:00
djsrv 86dcef45ea DIRECTOR: Fix per-cast font mappings
Font mappings are per-cast, so we can't override the WM's font IDs,
which are universal.
Now a TextCastMember's _fontId uses the per-cast font IDs, and the
Cast's _fontMap gives the corresponding WM font ID.
2021-07-02 18:08:21 -04:00
djsrv 7bfa8aa6dc DIRECTOR: Add castLibID to Cast 2021-06-30 22:32:19 -04:00
djsrv 8dfa5f4e73 DIRECTOR: LINGO: Use member ID as script ID in D2-3
Movie scripts have a corresponding text cast member, so it makes sense
to have the IDs match.
2021-06-30 22:32:19 -04:00
ysj1173886760 b659c964f7 DIRECTOR: make debug output more readable 2021-06-30 16:29:00 +02:00
djsrv 4b30859276 DIRECTOR: Make _modified protected
We should always use isModified() outside of the CastMember class since
it can be overridden.
2021-06-29 15:19:24 -04:00
djsrv f54ebabe23 DIRECTOR: LINGO: Add TestScript type 2021-06-22 18:16:53 -04:00
djsrv ff7943d576 DIRECTOR: Make loadArchive return false if no VWCF 2021-06-07 15:06:00 -04:00