Commit Graph
265 Commits
Author SHA1 Message Date
Misty De Meo 8f79e5ee6c DIRECTOR: CAST: remove reference check 2023-01-15 14:43:50 -08:00
Misty De Meo 6af5e86a77 DIRECTOR: openMainArchive may be opening an EXE
This fixes Fukuoka-Go-Round, which ends up passing the main EXE as a movie
to (re)open at runtime instead of a movie. Without this, clicking back to
the main menu crashes the disc.
2023-01-15 23:32:06 +01:00
Scott Percival 48740a2ad1 DIRECTOR: Remove all palette reversing workarounds
All of the builtin palette lookup tables have been reversed, to match
the original layout of the tables in the Director 4 projector executable.
This corresponds with the colour indexing used in Lingo.
Likewise, the code to load palettes from the cast no longer reads the
colours in reverse order, and shiftPalette no longer expects
the start index to be after the end index.

DirectorEngine::transformColor still exists to upgrade to 32-bit colour,
but no longer reverses the palette index.

The missing builtin 16-color palettes from Director 4 have been added.
2023-01-10 13:41:53 +01:00
Eugene Sandulenko 21c77c7a65 DIRECTOR: Cache cast members by name and type 2022-12-03 00:24:18 +01:00
Eugene Sandulenko 97b7cb60fd DIRECTOR: Added API for referring to the cast members by name and type 2022-12-03 00:24:18 +01:00
Scott Percival 8f15436896 DIRECTOR: Include more cast information in debug output 2022-11-18 16:28:05 +01:00
Roland van Laar 144dfead98 JANITORIAL: DIRECTOR: remove superfluous ':' 2022-10-18 22:02:41 +02:00
Roland van Laar 1ec0dfb5e1 DIRECTOR: Fix segfault when loading broken pic
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
2022-10-18 09:34:37 +02:00
Roland van Laar 2c466952d9 DIRECTOR: Simplify opening stream Cast::loadConfig
Remove check if resource exists in the stream when loading a cast.
This check is already executed by `Archive::getMovieResourceIfPresent`.

Coverity found this as a Deference null return value due to not
checking if the stream was not a nullptr.

Fixes COVERITY: 1491676
2022-09-26 12:32:09 +02:00
Scott Percival 4e22e09685 DIRECTOR: Prevent CastData leak if multiple with the same ID 2022-09-25 10:35:03 +02:00
Roland van Laar 15ee7ba98a DIRECTOR: LINGO: fix memory leaks for lingo tests
The Lingo tests were failing because of memory leaks.
- `move` overwrote an existing cast without deleting it
- `puppetTransition` was set but not removed on class destruction
- the *.lingo test files were opened but never removed
2022-09-24 23:21:38 +02:00
Roland van Laar 0091a20fe9 DIRECTOR: limit files closed by closeResFile
Lingo function `closeResFile` is only responsible for closing resource
file opened by `openResFile`. Register in `openResFile` which files
where opened and close only those files in `closeResFile`.

- Rename `_openResFiles` to `_allOpenResFiles` and
- Add new `_openResFiles` hashmap to track which files were opened in
  `openResFile`.
2022-09-23 22:55:50 +02:00
Roland van Laar 423783f394 JANITORIAL: DIRECTOR: Improve debug message
Make debug message reference the function it's in.
Not the old one.
2022-09-23 22:09:40 +02:00
Roland van Laar 074981ba73 DIRECTOR: filter cast list on id in debugger
Add option to only show the cast with castId in the debugger.
2022-09-21 16:22:34 +02:00
Scott Percival 5c5929737d DIRECTOR: Implement cast debugger command 2022-09-20 20:17:06 +02:00
Roland van Laar 477667688d DIRECTOR: Fix memory leak in Cast::loadBitmapData
Delete `pic` when returning early.
2022-09-20 16:30:57 +02:00
Roland van Laar d4ab4b3514 JANITORIAL: DIRECTOR: whitespace cleanup 2022-09-20 16:15:41 +02:00
Roland van Laar 43a2e79dec DIRECTOR: Cleanup memory leaks in LingoArchive
Create a variable on ScriptContext to track if it's only in
lctxContexts to ease deletion.

Factories and scripts with script id < 0 are tracked and deleted on
~LingoArchive. The hashmaps lctxContexts and scriptContexts overlap in
the values. The forementioned factories and scripts with script id < 0
were only in lctxContext.
scriptContexts was already cleaned up in ~LingoArchive.
2022-09-20 16:09:20 +02:00
Roland van Laar 28731c24f7 DIRECTOR: revert 1b6e233 Let Cast class manage ...
registering the archive

Resource forks were closed when switching to a different movie.
Those resource forks need to stay available.

In this case for cursors for Star Trek: The Next Generation Interactive Technical Manual

This reverts commit 1b6e2335b3.
2022-09-16 20:35:13 +02:00
Roland van Laar 1d88dabd70 DIRECTOR: fix crash when stxtsid isn't available
Check if the the key requested from loadedStxts is available before
getting the value.

Star Trek Omnipedia requests stxt id 5, which isn't loaded.
Resolves: https://bugs.scummvm.org/ticket/13341
2022-09-14 12:20:37 +02:00
Scott Percival af0dd7abe1 DIRECTOR: Pass mutable reference to Cast::loadPaletteData()
Fixes regression introduced in 411395565b
2022-09-12 15:52:18 +02:00
Scott Percival c7efa10493 DIRECTOR: Fix loading defaultPalette from config block
Fixes regression introduced in e4f1471aa9
2022-09-12 15:52:18 +02:00
Scott Percival 7fc407bc4b DIRECTOR: Plug more memory leaks 2022-09-12 15:52:18 +02:00
Roland van Laar bf7d2584a4 DIRECTOR: add reading of kCastMovie cast data
CastMovie cast data is now parsed. A first step to implement
CastMovies.

CastMovies are references to other director movies and
can be played inside the current movie. Star Trek an interactive
manual makes use of them.

The flags raw data was:
  100110 no flags
  101110 sound
  000110 loop
  100100 crop
  100101 crop and center
  110110 enable scripts
  011011 everything
2022-08-29 23:16:42 +02:00
Roland van Laar 411395565b DIRECTOR: Refactor cast load data
Multiple functions looped over the whole to cast to filter out specific
cast member types and load data.
The looping is contained to loadCastMemberData. Loading for each
cast type is refactored to have a function per type.
2022-08-29 21:18:29 +02:00
Scott Percival 6654d1d048 DIRECTOR: Fix freeing up cast members 2022-08-28 10:31:00 +00:00
Roland van Laar f92492f4a1 Revert "DIRECTOR: Check for cast children in buildbot"
Cast::loadCastChildren() iterates over all casts, not just the ones that
have children. The original commit gave a buildbot error for all casts
that weren't handled by loadCastChildren.

This reverts commit ec5e0cf1b6.
2022-08-27 23:40:00 +02:00
Roland van Laar ec5e0cf1b6 DIRECTOR: Check for cast children in buildbot
Not all cast types are handled when the cast is a child.
For example lingo scripts. This commit will notify us where other
unhandled cast childres exist.
2022-08-26 23:43:55 +02:00
Misty De Meo 208ebdc423 DIRECTOR: revert VWCR change
This reverts commit 706373079d.
2022-08-09 21:46:45 -07:00
Misty De Meo 706373079d DIRECTOR: fetch VWCR more safely
The previous version could end up with `r` assigned to `nullptr`,
leading to a crash when trying to free it.
2022-08-09 21:26:28 -07:00
D G Turner 50d70afe72 DIRECTOR: Fix GCC Compiler Warnings 2022-08-10 01:52:58 +01: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 e4f1471aa9 DIRECTOR: Implement VWCF resource checksum validation for pre-D7 movies 2022-07-23 23:51:14 +02:00
Pragyansh Chaturvedi 1a5603c488 DIRECTOR: LINGO: Remove all occurences of _loadedCast outside of the Cast namespace 2022-07-13 18:10:49 +02:00
Pragyansh Chaturvedi 686e720275 DIRECTOR: Implement Movie::createOrReplaceCastMember() and Cast::setCastMember() functions, add blend2.pic to tests 2022-07-03 19:24:04 +02:00
Henrik "Henke37" Andersson 1b6e2335b3 DIRECTOR: Let Cast class manage registering the archive
This fixes a null pointer crash and potential issues when switching between movies.
2022-06-23 20:26:37 +02:00
Eugene Sandulenko 7db17ac189 DIRECTOR: Fix warning and add clarifying comment 2022-06-21 01:13:55 +02:00
Pragyansh Chaturvedi (r41k0u) ee242176af DIRECTOR: LINGO: Implement kTheFixStageSize property STUB 2022-06-21 01:08:10 +02:00
Eugene Sandulenko b7735a6326 DIRECTOR: Encapsulated tile access and implement override by VWTL 2022-06-15 01:01:05 +02:00
Eugene Sandulenko f15e1170e7 DIRECTOR: Fix VWTL loading 2022-06-11 13:49:46 +02:00
Eugene Sandulenko 19e078a886 DIRECTOR: Implement VWTL loading (not used yet) 2022-06-11 02:07:34 +02:00
Roland van Laar 7e9a174122 DIRECTOR: Tighten buildbot: error on kCastMovie 2022-03-30 23:39:40 +02:00
Pragyansh Chaturvedi (r41k0u) 5496db64fb DIRECTOR: Add duplicate lingo command 2022-03-29 16:09:37 +02:00
Eugene Sandulenko 1769ef268e DIRECTOR: Use directory for external sound casts. Fixes #13307 2022-03-21 23:08:35 +01:00
D G Turner 810c528453 DIRECTOR: Fix Set But Unused Variable Compiler Warnings
These are emitted by GCC if -Wunused-but-set-variable is passed.
2022-03-15 21:03:03 +00:00
Eugene Sandulenko f07c7311d5 DIRECTOR: Implement Sord chunk loading (not used by ScummVM) 2022-03-15 21:07:15 +01:00
Roland van Laar d5fd9e4eb1 JANITORIAL: Remove space before semicolon 2022-03-13 13:43:19 +01:00
Roland van Laar c223a8f883 Director: Remove framerate fallback
The framerate byte is now understood. A framerate byte of 0 means a
framerate of 3. Which is handled during framerate parsing.
The check for 0 is therefor redundant.
2022-03-10 17:50:24 +01:00
Roland van Laar 01e914d937 Revert "DIRECTOR: Buildbot to test for lightswitch bit"
This reverts commit 5709e19d98.
2022-03-10 17:44:16 +01:00
Roland van Laar 5709e19d98 DIRECTOR: Buildbot to test for lightswitch bit 2022-03-10 17:20:49 +01:00