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.
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.
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.
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.
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.
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"
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.
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.
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)
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.
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.
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)
FactoryScripts are now dumped with their 'factory-<name>' in the dumped
filename.
Factory scripts are different in that they are not associated with a cast and have a
scripType that is kNoneScript, i.e. -1.