Commit Graph
143 Commits
Author SHA1 Message Date
Scott Percival 1f8de850f0 DIRECTOR: Quieten benign warnings 2025-02-08 14:45:53 +01:00
Scott Percival c6d6785447 DIRECTOR: Fix loading Lingo scripts from different internal casts
Fixes the block minigame in Fisher Price Learning in Toyland.
2024-11-11 20:40:06 +01:00
Eugene Sandulenko 5406770710 DIRECTOR: Added some archive format notes 2024-06-03 20:30:20 +02:00
Eugene Sandulenko 6801c993de DIRECTOR: Added more debug output on archive loading 2024-06-03 14:00:11 +02:00
Eugene Sandulenko f352a3e1cc DIRECTOR: Improved loading log messages 2024-05-24 01:11:31 +02:00
Eugene Sandulenko 9e6ceb89b9 DIRECTOR: Hid loading logs under Loading channel 2024-05-13 23:09:50 +02:00
Scott Percival 10b2abcd9b DIRECTOR: Fix MacArchive::getFileSize() 2024-02-09 21:17:57 +08:00
Le Philousophe cf3eac29c3 DIRECTOR: Migrate engine to Path 2023-12-24 13:19:25 +01:00
sluicebox 1bb58d7937 DIRECTOR: Remove freeing nullptr. PVS-Studio V575
This was left over from a refactor.

See: ecd6f218df
2023-10-31 14:20:29 -07:00
Eugene Sandulenko 8bccc12786 DIRECTOR: Reduce header dependency 2023-08-02 21:05:06 +02: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
Misty De Meo 45036ad1c3 DIRECTOR: put chunk log behind debug flag 2023-06-22 20:50:24 -07:00
Eugene Sandulenko 7dff783c74 DIRECTOR: Skip more unused chunks 2023-06-12 15:49:44 +02:00
Eugene Sandulenko aed4c89b13 DIRECTOR: Print out list of unprocessed chunks in Director files 2023-06-11 23:24:47 +02:00
Eugene Sandulenko 450bd74fad DIRECTOR: Attempt to fix memory leaks on unsuccessful projector open attempts 2023-06-08 16:08:09 +02:00
Scott Percival 458e97933d DIRECTOR: Refactor archive loading code
Make DirectorEngine::_allOpenResFiles the de-facto owner of Archive *
objects, move all of the various loadEXE/loadMac methods off Window and
onto DirectorEngine, and replace inline Archive loading with
openArchive().
2023-06-08 09:16:30 +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
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 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
Scott Percival 459115fb78 DIRECTOR: Fix castInfo loading for D5 2023-04-29 14:20:05 +02:00
Scott Percival 570bbfb7f1 DIRECTOR: Add "info" command to debugger 2023-03-06 21:26:28 +01:00
Eugene Sandulenko d2e56053f0 DIRECTOR: Dump RIFF resources when requested 2023-01-26 12:52:52 +01:00
Eugene Sandulenko 389c6725ea DIRECTOR: Do not crash when script dumping is requested 2022-12-02 10:56:43 +01:00
Eugene Sandulenko af94562bbe DIRECTOR: Fix dumped movies from .exe files. Patch courtesy of eientei 2022-12-02 10:39:59 +01:00
Roland van Laar 9a6dea9466 DIRECTOR: Fix memory leaks in archive.cpp
The newly used Common::SeekableReadStreamEndianWrapper was leaking.
Setting the DisposeAfterUse to YES resolved the leaks.
2022-11-30 10:51:41 +01:00
Roland van Laar 78bd7e7fd5 DIRECTOR: Fix compilation deprecation warning
Remove uses of deprected `SeekableSubReadStreamEndian` in archive.cpp

The deprationwarning was:

    Use SeekableReadStreamEndianWrapper with SeekableSubReadStream instead
2022-11-29 22:11:02 +01:00
Cameron Cawley bca9a3e5b3 DIRECTOR: Use SeekableReadStreamEndianWrapper 2022-11-29 00:06:49 +01:00
Le Philousophe 29dea747a8 DIRECTOR: Don't use unsafe sprintf and vsprintf 2022-10-23 22:46:19 +02:00
Roland van Laar 2e39acf84c DIRECTOR: Improve RIFF loading
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!)
2022-10-18 22:02:41 +02:00
Scott Percival 095ae06405 COMMON: Refactor MacResManager::load* methods to accept a pointer
Previously the methods would pass by reference, then convert to a
pointer on success and take ownership. This isn't ideal, as a
reference suggests no transferral of ownership, and doesn't suggest
it needs to be a heap resource allocated by new.
2022-09-25 10:35:03 +02:00
Scott Percival 00a7d69fd1 DIRECTOR: Plug stream leak for Mac archives 2022-09-25 10:35:03 +02:00
Roland van Laar eb79194f86 DIRECTOR: Fix memory leak
Free data after allocating it for dumping resource chunks.
2022-09-19 23:08:55 +02:00
Roland van Laar 9ddb71fe6e DIRECTOR: Improve comment ILS
ILS is the initial load segment.
The part of a shockwave file that's needed to get things going and
other media can be loaded later over a slow 90s internet connection
2022-09-17 22:24:56 +02:00
Scott Percival 9e17e5aa85 DIRECTOR: Plug memory leak 2022-09-12 15:52:18 +02:00
Misty De Meo 43d96157e5 DIRECTOR: unify getResource behaviour 2022-08-16 17:43:33 -07:00
Misty De Meo 1ed15b789d DIRECTOR: only record valid MacArchive members 2022-08-09 22:22:11 -07:00
djsrv fac330bec4 DIRECTOR: Don't fall back to getFirstResource if chunk not in KEY*
There doesn't seem to be any case in which we should fall back to
getFirstResource in D4 as found in #4172. So we can remove that fallback
and the associated warning.
2022-08-10 00:18:04 -04:00
djsrv 28b7b0b297 DIRECTOR: Handle collisions between movie and cast member IDs 2022-08-10 00:11:20 -04:00
Pragyansh Chaturvedi dbe1ae48d5 DIRECTOR: Use KEY* mappings instead of taking the first resource to load chunks 2022-08-09 16:18:15 -05:00
Pragyansh Chaturvedi 8f9da662cc DIRECTOR: Implement _movieChunk to store indices of chunks having 1024 as parent 2022-08-09 16:18:15 -05:00
Pragyansh Chaturvedi 766d74f8f6 DIRECTOR: Read KEY* resource before reading CAS* resource 2022-08-09 16:18:15 -05:00
Eugene Sandulenko 2d30fcb84f DIRECTOR: Fix file sizes for dumped Mac resources 2022-07-05 15:22:12 +02:00
Eugene Sandulenko acac0a5f27 DIRECTOR: Fix dumping Mac resources 2022-07-05 14:13:59 +02:00
eientei f9e16e59ed DIRECTOR: +Casino 5 Pack; fix dumpChunk bug where getResource can return nullpointer 2022-06-22 23:38:15 +02:00
Pragyansh Chaturvedi (r41k0u) ecd6f218df DIRECTOR: Refactor dumping of RIFX chunks to dump all archive chunks 2022-06-14 23:11:58 +02:00
Roland van Laar c546990e21 DIRECTOR: Fix use after free
probeMacBinary when macArchive has a rsrc fork, otherwise delete the
archive. The archive is deleted during ~Director cleanup.
2022-03-29 23:21:09 +02: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