It's possible for audio playback to still be underway at the time the
AudioFileDecoder is destroyed. For Mac games, destroying the _macresman
will also destroy the stream, feeing the pointer while it may be read from
in another thread. Copying the audio instead of just fetching the stream
from the MacResMan ensures that new stream will outlive the MacResMan if
necessary.
Fixes https://bugs.scummvm.org/ticket/13881.
In Director, Lingo calls to fetch "the pathName" would provide an absolute
path, including the volume. getCurrentPath() originally provided a
relative path, which meant root level would return "". There is at least
one title that checks "the pathName" isn't blank as part of the content
detection routine. Given that from an internal perspective,
getCurrentPath() is always an absolute path from the game root, we can
add a fake drive letter for Windows at the front.
Fixes loading in DEVO Presents: Adventures of the Smart Patrol.
While `go` is intended to be called with either one int arugment or
one string and one int argument, Director accepts multiple int args.
In this case, it treats the first argument as an integer and silently
discards the rest. Before this branch, ScummVM would always treat two
arguments as being the movie + frame case and throw a typecheck error
for the first argument. This fixes it by checking the type of the first
arg and discarding the rest, matching Director's behaviour.
This was seen on the title screen of Wallobee Jack: The Thai Sun Adventure,
which calls it like so: `go (the frame) 0`
Two improvements for RIFF loading: size and alignment
A RIFF elements header: FourCC and size (4 bytes each) are not included
in the size. Offset + 12 then size - 4.
'DIB ' resources were found to always lead with two zero bytes.
Tested with: Fujitsu fmTOWNS SUPER TECHNOLOGY DEMO 1993.
Other resources such as 'SND ' do need alignment.
Tested with: SpaceWarlock Win. Intro movie lacked sound without
alignment. (WARNING: SNDDecoder: Bad format: 17408!)
Handle loadStream returning false when the pic doesn't confirm.
In this case a 'DIB ' with a headersize not matching 40.
Observed happening in:
- Fujitsu fm TOWNS Super TECHNOLOGY DEMO
- KUZIRA.MMM from PINGU
Widget is an XObject used in Alice: An Interactive Museum.
The assumption is that getPro returns the drive letter as
the return value of getPro is assigned to a variable called drv.
Resolves the following errors from: https://bugs.scummvm.org/ticket/13204
- WARNING: BUILDBOT: Uncaught Lingo error: Call to undefined handler 'Widget'. Dropping 1 stack items!
- WARNING: varFetch: global variable drv not defined!
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)
Don't map the same fromFont twice.
CloneRanger mapped one fromFont twice, resulting in a memory leak on
descruction since the pointer to the first fontMap was lost.
Stubbed b_duplicate again.
The implementation was broken, it copied the reference to the cast not the
cast itself.
Adds warning to createOrReplaceCastMember.
The function only handles replacing not creating.
Memory leak happens when a cast is moved but without
specifying the place for it to move to.
Datum constructor gets the castMemberId by copy leaving the
resource to be dealt with by the original function.
- Includes lingo test.
Fixes COVERITY: 1498924