Commit Graph
140 Commits
Author SHA1 Message Date
Eugene Sandulenko 1fc80ff666 DIRECTOR: Fix compilation on some platforms 2024-05-14 23:11:01 +02:00
Eugene Sandulenko 88239fb184 DIRECTOR: Added ProjectorRays' Lingo Decompiler
Hash id 5f23e27fcca9030b42f024d656f00b84c81d3cfc
2024-05-14 22:32:02 +02:00
Eugene Sandulenko 126cba16cf DIRECTOR: Factored out XPFloat reading 2024-05-14 18:27:58 +02:00
Scott Percival 13fa4baf72 DIRECTOR: Split savename prefix into common method 2024-05-12 22:00:19 +02:00
Scott Percival 1c07d3e9aa DIRECTOR: Move save modal glue into function 2024-05-12 22:00:19 +02:00
Scott Percival d43612db85 DIRECTOR: XOBJ: Refactor methods to pass path to library 2024-03-31 16:58:31 +02:00
Scott Percival b163dba86d DIRECTOR: Add CD loading delay quirk
Spaceship Warlock is optimised for very slow disk reads; quite a lot of
movie changes will be preceded by a music cue and a still image, knowing
that the system will take a couple of seconds to read the next file.

As a compromise, add a fake delay of [file size]*1000/150000 ms to movie
switches. This can be short-circuited by clicking the mouse, so it is
still possible to navigate around quickly.
2024-02-09 21:17:57 +08:00
Scott Percival d3ffe66fe5 DIRECTOR: Fix handling of relative path markers
It is possible to use relative path syntax (e.g. multiple colons in Mac
path syntax, . or .. in Windows path syntax) to move up the directory
tree in relation to the current path. Because resolvePath() works from a
fixed base, we have to rectify any paths with relative markers so they
become an absolute path, which is then resolved in the usual way.

Fixes entering the bridge for the Asteroid or Terra missions in
Spaceship Warlock; both of these movies need to jump to a movie
named BBalcView in a different folder, and without rectification it will
select BBalcView in the current (WARLOCKSHIP) folder which is used for
the first mission only.
2024-02-09 21:17:57 +08:00
Scott Percival b4bdc229db DIRECTOR: Use Shift-JIS text decoder when g_lingo->_romanLingo is false
Fixes most of the dialogue interaction scripts in the English version of
Cosmology of Kyoto, which contain plenty of Shift-JIS text.
2024-01-20 23:14:52 +01:00
Scott Percival 7ecda7e3b7 DIRECTOR: Disable Windows keycode table for D4 and up
Fixes keyboard entry in Cosmology of Kyoto for Windows.
2024-01-20 23:14:52 +01:00
Le Philousophe cf3eac29c3 DIRECTOR: Migrate engine to Path 2023-12-24 13:19:25 +01:00
Le Philousophe 5bdd9e6f50 ALL: Unify zlib and gzio API
zlib is used when available and falls back on gzio.
This allows performance improvements as our CRC32 and gzio
implementations are slower than base zlib.
As zlib is available when libpng is present, this is sensible to
benefit from it.
2023-08-28 21:49:03 +02:00
Eugene Sandulenko 8bccc12786 DIRECTOR: Reduce header dependency 2023-08-02 21:05:06 +02:00
Scott Percival aa32a51c47 DIRECTOR: More fixes for partial filename matching
For Macintosh, it is possible to have filenames with a "/" in them.
Dumper Companion will punyencode this and any other non-ASCII characters
when extracting from a Macintosh filesystem. As such, when checking
components of a filename, we should attempt to match against the punydecoded
name, but always return the "real" name (i.e. the name of the file in
the local filesystem, possibly punyencoded).

In addition, it is possible for a movie A/B/C.DIR to go to a movie
"E/F.DIR", where the actual path is A/E/F.DIR. To make the partial matching
work, first we try removing each component from the start of the target
path, then retry all combinations again after removing a component from
the end of the source directory, etc.

Fixes several movie switches in The Seven Colors.
2023-07-08 22:01:00 +03:00
Scott Percival 8a6d7d6c95 DIRECTOR: Move file extension checks to innermost loop
Fixes shared cast detection in Meet Mediaband.
2023-07-08 22:01:00 +03:00
Scott Percival 93bd0741d6 DIRECTOR: Interrogate SearchMan for path matches 2023-07-08 22:01:00 +03:00
Scott Percival 3245ae99fa DIRECTOR: Rework resolvePath functions to pass Path instead of FSNode 2023-07-08 22:01:00 +03:00
Scott Percival 2690a238ce DIRECTOR: Add extensions if required when loading audio files
Fixes several sound effects in Hamsterland: The Time Machine.
2023-07-08 22:01:00 +03:00
Scott Percival 17e1853347 DIRECTOR: Refactor path detection
Previously, paths were verified by pathMakeRelative().
This method had several drawbacks; the code was increasingly ad-hoc
and recursive, and the function would return a Common::String that
was not guaranteed to be distinct. 90% of the time the path would need
to be converted to Common::Path so that file streams could use it.

This code has been replaced with findPath(), a function which takes a
path string as recieved from Director (e.g. a Lingo script, a filename
stored in a CastInfo record) and returns a Common::Path object for the
file on the local system. The inner workings have been split into subfunctions,
which should make it easier to add workarounds and fuzz at the correct
layer.
2023-07-08 22:01:00 +03:00
Eugene Sandulenko 7baba61852 DIRECTOR: Modernized rest of the loops 2023-06-29 23:22:38 +02:00
Eugene Sandulenko 2bfb94897b DIRECTOR: Dump also parent scripts used in D5+ 2023-06-25 13:46:08 +02:00
Misty De Meo 7c13c3ce51 DIRECTOR: Windows paths can begin with @ 2023-06-07 16:39:14 -07:00
Eugene Sandulenko 1b8e614bc8 DIRECTOR: Fix b_offset implementation and make it case-insensitive
It must use Director character order.

This also implemented d_strstr() function as strstr() replacement

The side effect of it is the7colors navigation was broken. It contains
the following code:

  set offs = offset("ROOM.I/O",the pathname) - 1
  set path = chars(the pathname,1,offs)&"01.Colidor:"

the pathname is "01ROOM:Room.I/O:" that does not match "ROOM.I/O"
2023-05-31 23:16:02 +02:00
Misty De Meo 25ebcb974b DIRECTOR: .exe is a valid movie ext
Fixes Mylk (Win), which tries to return to the main screen by opening
mylk.exe via a call to open the movie "MYLK".
2023-05-18 22:07:43 -07:00
eientei 68939befcb DIRECTOR: cp1250 -> cp1252 in order table comments 2023-05-17 20:36:10 +02:00
eientei 04153f915a DIRECTOR: Add order tables for D8.5+ (Win) and D8.5 (Mac) 2023-05-17 20:36:10 +02:00
Scott Percival 96855f1cf7 DIRECTOR: Add D5 file extensions to pathMakeRelative 2023-05-10 09:48:50 +02:00
Scott Percival 6db1f878ef DIRECTOR: Add cast action scripts to debug output 2023-03-24 21:27:34 +01:00
Sathvik GilakamsettyandEugene Sandulenko 1e581a398e DIRECTOR: Implement generic setMachineType()
Based on information collected by timofonic here: https://wiki.scummvm.org/index.php?title=Macintosh_Hardware


Co-authored-by: Eugene Sandulenko <sev@scummvm.org>
2023-03-09 01:17:44 +01:00
Scott Percival debb6425d4 DIRECTOR: Don't search for absolute paths
Previously, pathMakeRelative didn't make a distinction between relative
and absolute paths. The input would always be converted to a relative
path, then checked against a number of places (e.g. the current
working directory, all the locations in the search path...).

This causes an issue for functions such as getNthFileNameInFolder. Quite
often, this is used for absolute paths constructed with "the pathName"
as a base. ScummVM assumes the game root is also the root of the volume
(e.g. "C:\"). As such, when you would call getNthFileNameInFolder("C:\",
1), this would be translated to a relative path of "", and then match
with the current directory provided from getCurrentPath; clearly not the
same thing.

To fix this, we detect if the input to pathMakeRelative is an absolute path,
and if so avoid checking every location in the search path and prefixing
the result with getCurrentPath().

Fixes "I am unable to save or retrieve games" error message in The Dark Eye.
2023-03-06 21:26:28 +01:00
Scott Percival 19ade1dba9 DIRECTOR: Fix pathMakeRelative search path resolution
pathMakeRelative will attempt to look for files in locations listed in
the search path. This can include directories that don't end with a
separator. As such, ensure that paths being tested have a separator so
they don't get accidentally merged with the target filename.

Fixes the loading sequence in The Dark Eye.
2023-03-06 21:26:28 +01:00
djsrv d944febd1f DIRECTOR: Sync humanVersion with ProjectorRays 2023-02-21 14:44:13 -07:00
Eugene Sandulenko 82cbdc5300 DIRECTOR: Catch unknown platforms by the buildbot 2023-02-13 16:24:46 +01:00
Eugene Sandulenko b9f901b24f DIRECTOR: Moved type->string utilities to types.cpp 2023-02-13 16:24:46 +01:00
Eugene Sandulenko b1d193cc24 DIRECTOR: Added D4J sorting table 2023-02-11 16:24:00 +01:00
Eugene Sandulenko 5c3586bd67 DIRECTOR: Fix makePathRelative() with directories 2023-02-10 20:59:15 +01:00
Eugene Sandulenko 6440de5ee4 DIRECTOR: Added indentation to the pathMakeRelative() debug output 2023-02-10 20:59:15 +01:00
Eugene Sandulenko 8db30fce73 DIRECTOR: Convert path before making it relative.
That will make sure that Windows disk references will be cleaned up.

Used in mcluhan-win startup where it calls getNthFileNameInFolder("C:\prefs\Notes", 1)
2023-02-10 20:59:14 +01:00
Eugene Sandulenko 85ef974d55 DIRECTOR: Override delayMillis() and skip delays when fast execution is requested 2023-01-28 23:53:59 +01:00
Vladimir Serbinenko af7d9cb850 COMMON: Move punycode_*codepath to path.cpp
This allows to reduce access to DIR_SEPARATOR from outside of Common::Path
2022-12-14 05:08:46 +01:00
Eugene Sandulenko b33e2b76d4 DIRECTOR: Implement proper string comparison
Director is full of surprises.

This fixes fortune teller input in the Panic Park demo
2022-12-10 17:45:59 +01:00
Eugene Sandulenko fb7095f5a4 COMMON: Move all compression-related files to a separate directory 2022-12-01 11:53:02 +01:00
eientei a49e473fe9 DIRECTOR: JANITORIAL: Spelling fixes in comments 2022-12-01 01:18:11 +01:00
Vladimir Serbinenko 17a2ce8c5a DIRECTOR: Accept MacBinary for Macintosh and Pippin versions
Pippin videos for Lzone have resource fork and end up in MacBinary format.
This apparently fixes Pippin version of L-zone but I didn't check whether
it's completable.
2022-11-28 23:00:33 +01:00
Misty De Meo 08c3bfe6d6 DIRECTOR: do not trim path during search
This was introduced in 3cae55dc3a due
to a bug encountered in Majestic. That was, however, a distinct bug
caused by something else, and the root cause was fixed in
9c3de4c269. Trimming whitespace broke
games which loaded paths that legitimately began with whitespace. This
notably broke Wacky Races (Mac, Japan), which has directories that begin
with a single space.
2022-11-11 16:40:39 -08:00
eientei b96174c02e DIRECTOR: testExtensions: Try the non-converted filename as well
Required to get Wrath of the Gods to play, because due the existing code, when given `30AM1`, it was only checking `30AM1` and `AM1.MMM` but not `30AM1.MMM` (which is what the file is called)
2022-10-17 12:47:04 +02:00
Roland van Laar 9aafdcf976 DIRECTOR: Fix unchecked return value
getChildren returns false when not succesful, i.e. meaning we can bail
out of the loop iteration.

Fixes COVERITY: 1462418
2022-10-07 17:05:46 +02:00
Scott Percival c1ebb4d52d DIRECTOR: Implement funcs debugger command 2022-09-20 20:17:06 +02:00
Scott Percival 533dd7c78f DIRECTOR: Fix searching for files in subdirectories
Fixes regression introduced in 0c09bba0f6

Fixes resource detection in Total Distortion.
2022-09-12 15:52:18 +02:00
Misty De Meo 0c09bba0f6 DIRECTOR: do not try to open dirs as files 2022-08-08 13:06:16 -07:00