Commit Graph
148 Commits
Author SHA1 Message Date
Harishankar Kumar 7421ccdc39 DIRECTOR: Fix formatting and change method names 2023-08-03 09:49:20 +02:00
Harishankar Kumar 442c1a5d41 DIRECTOR: Implement events for scroll type text cast
This patch implements events for scrolltype text cast members, callbacks
in MacTextWindow is used to redirect events to director engine.

`ATD\HD\bbTWRFL2.DXR@392` of 'totaldistortion-win' uses `mouseUp` score
script attached to scrolltype text cast member, which when clicked calls
`getMouseLine` to find the clicked book, thus opening it.
2023-08-03 09:49:20 +02:00
Harishankar Kumar 6dbbed5d2b DIRECTOR: Release channel widget from window manager if window type 2023-08-03 09:49:20 +02:00
Eugene Sandulenko 8bccc12786 DIRECTOR: Reduce header dependency 2023-08-02 21:05:06 +02:00
Harishankar Kumar 7b6b6a5541 DIRECTOR: Refactor checks inside setAutoPuppet function
To make code cleaner and avoid duplication of code, moved the checks
inside setAutoPuppet function.
2023-07-19 14:57:59 +02:00
Harishankar Kumar e01bb235f7 DIRECTOR: Support individual auto-puppet sprites properties
According to "Director in a Nutshell, page 15", autoPuppet unlike
puppet is not a single property, instead it is individual for each
sprite property, ie we can have auto-puppet locH of sprite, but
other properties are not auto-puppet.

This change adds support for individual auto-puppet properties.
2023-07-19 14:57:59 +02:00
Harishankar Kumar 994d284d71 DIRECTOR: Set sprite _startPoint when setting location
Initially, all the changes to sprite location (ie set the locH..) was
being assigned to _currentPoint, which is not carried over to sprite,
thus the changes were not being applied.

Fixes bullet not showing when firing gun in
--start-movie="ATD\HD\bdDREAMA.DXR" totaldistortion-win
2023-07-19 14:57:59 +02:00
Harishankar Kumar 59f0433c5a DIRECTOR: Add >=D6 checks to autoPuppet cast property. 2023-07-19 14:57:59 +02:00
Eugene Sandulenko 87b96cd34e DIRECTOR: Re-add Director version checks for autopuppet flag
Dropping D6+ checks there were a speculation which let Dream sequence
in totaldistortion work. However, that had a side effect that the ink
was not copied, as the channel was declared autopuppet.

This restores the ink behaviour while keeping shooting as working

--start-movie="ATD\HD\bdDREAMA.DXR"  totaldistortion-win
2023-07-14 22:34:38 +02:00
Eugene Sandulenko 9160173b0a DIRECTOR: Do not override autopuppet sprites 2023-07-10 16:03:11 +02:00
Eugene Sandulenko f594c08eca DIRECTOR: Treat autopuppets same as puppets when looking at sprite changes 2023-07-10 16:03:11 +02:00
Eugene Sandulenko e99a9d4511 DIRECTOR: Check sprites for bg/fg changes when rendering 2023-07-10 16:03:11 +02:00
Eugene Sandulenko 4a259ea14f DIRECTOR: Set autopuppet flag for all D versions 2023-07-10 16:03:11 +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 6acba833de DIRECTOR: Properly fix set rect of sprite
We used to check against puppet: wrong, it even gets autopuppeted
We used to check against stretch: wrong, we just do not stretch the sprite

This properly fixes cursors in devo and darkeye without disabling setting
the rect property.

See commit 18f140ef91
2023-07-01 16:39:35 +02:00
Eugene Sandulenko 18f140ef91 DIRECTOR: Do not set autopuppet flag on rect of sprite
This ifxes cursor regression in devo (initial movie) and
dark eye (--start-movie=DKYDATA/DIRFILES/NT.DIR)
2023-06-30 23:51:35 +02:00
Harishankar Kumar 5a5e205e0d DIRECTOR: Add _autoPuppet flag, initial work for D6 auto-puppeting
[Based on Director in a Nutshell, page 15]
The following properties of a sprite are auto-puppeted whenever
the property is set: backColor, blend, editable, foreColor, height,
ink, loc, locH, locV, member, moveable, rect and width. Auto-puppeting
of individual properties has no effect on the puppet of sprite property

['Lingo Dictionary' 601 Fixes]
Sprites now have a duration as specified in the (new) score view.
When lingo modifies any of the sprite properties that property
will be auto-puppeted, i.e. the value set will stick for the
duration of that sprite despite any values recorded in the score.
This can cause existing lingo which relied on setting the property
of a sprite without the use of 'puppet' to behave differently.
Calling 'puppetSprite spriteNumber, FALSE' will also clear any
currently auto-puppeted properties.
2023-06-10 16:18:34 +02:00
Harishankar Kumar bcd4a82075 DIRECTOR: remove puppet checks when setting sprite properties
In original engine it is possible to set non-puppted sprite properties
like position, backcolor etc and then call updatestage to update the
screen according to property. This is undocumented behaviour
which is not present depicted in any books however with rigorous testing
it is found to be true. This change only persist for the current frame
and once the playback head is moving the change is lost.

`ATD\HD\bdDREAMA.DXR` of 'totaldistortion' used some of this quirk to
display moving bullets.
2023-06-10 16:18:34 +02:00
Eugene Sandulenko ef6a7b7daf DIRECTOR: Setting sprite box is allowed for stretched sprites, and add sanity checks
This fixed picking animals in zoo in the7colors. --start-movie=06DEPTSTORE:7F:DeptP3-06
2023-06-03 00:03:36 +02:00
Scott Percival cf886b17e7 DIRECTOR: Fix regression in sprite dragging
Sprites with the movable attribute set do not need to be a puppet.
2023-05-28 14:44:09 +02:00
Scott Percival bcb502d634 DIRECTOR: Move getRegistrationOffset and getBbox to CastMember 2023-05-28 14:44:09 +02:00
Eugene Sandulenko 2321decd30 DIRECTOR: Persist immeidate sprite flag when copying channels
Lingo `set the immediate of sprite` is getting lost when we copy over
the sprites to the channels. Now we inherit this setting in the copy.

Fixes 'PopUp Menu' in theapartment: without this fix we are losing the
interactivity as soon as we select a pop-up menu item once.
2023-05-17 23:14:07 +02:00
Scott Percival f703ee6ecf DIRECTOR: Split CastMember classes into files 2023-04-29 14:20:05 +02:00
Scott Percival 3cb61c54d7 DIRECTOR: Fix kInkTypeBlend, remove redundant _blend field on Sprite 2023-03-16 14:46:18 +01:00
Scott Percival 9ee0740844 DIRECTOR: Reset Channel::_movieTime when loading a new video
Fixes the animation of turning the ship in Gadget: Invention,
Travel and Adventure.
2023-01-27 13:31:21 +01:00
Scott Percival bbc464a7bc DIRECTOR: Fix matte display for 1-bit images 2023-01-10 13:41:53 +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
Scott Percival 665a76536e DIRECTOR: Fix setter for "the rect of sprite"
Normally you can only change the width and height of a sprite when the
sprite is a puppet, and the stretch flag is set. Apparently for shapes,
all that's required is the puppet flag.

Fixes the mouse cursor bounding box in DEVO Presents: Adventures of the
Smart Patrol.
2022-11-18 16:28:05 +01:00
Scott Percival 1524ee3615 DIRECTOR: Fix coloring of 1-bit bitmaps
If a channel contains a 1-bit bitmap cast member, use the foreground
color instead of black when rendering in Background Transparent mode.

Fixes various text bitmaps in Total Distortion and iD4 Mission Disk 1.
2022-11-18 16:28:05 +01:00
Scott Percival b2d13c5ea1 DIRECTOR: Stop playing videos when sprite gets replaced
Fixes cupcake song not stopping in Chop Suey.
2022-10-06 00:05:17 +02:00
Scott Percival e477106daa DIRECTOR: Update Channel::_movieTime in Score::updateWidgets
Previously this would be updated in
DigitalVideoCastMember::createWidget, which meant it was possible for a
movie to complete without updating _movieTime to the final end position.

Fixes the cupcakes from not stopping animating once the song is finished
in Chop Suey.
2022-10-06 00:05:17 +02:00
Scott Percival b572de94a4 DIRECTOR: Hardcode white and black in Channel::getPlotData()
Blit operations in Director expect that the "white" and "black" color
indexes are at 255 and 0, respectively. Fetching these values from
the window manager is not reliable when the palette has multiple
indexes sharing a color (e.g. blackPalette and whitePalette), which will
mean the applyColor flag is incorrectly set to true when foreColor and
backColor are the correct values.

Fixes fade from white when entering the door to the Land of Desire in
Eastern Mind.
2022-09-12 15:52:18 +02:00
Pragyansh Chaturvedi fb6497a059 DIRECTOR: Fix constrainH fail build step in BUILDBOT by adding _constraint check 2022-07-02 23:58:15 +02:00
Pragyansh Chaturvedi 42dfdd9f35 DIRECTOR: LINGO: Implement constraint in Channel::getBbox(), Fix getActive() to return true for movable sprites 2022-06-26 22:53:08 -05:00
Eugene Sandulenko c95d4245dc DIRECTOR: Simplify DirectorPlotData 2022-06-13 18:12:22 +02:00
Pragyansh Chaturvedi (r41k0u) 3610df85c6 DIRECTOR: Implement erase lingo command 2022-03-26 22:58:55 +01:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Scott Percival 2e77b6eaf6 DIRECTOR: Fix position of film loop subchannels
Sprites stored in frames are referenced by position (minus the
registration offset), width and height. Film loops are the same. As
such, fix the bounding box calculation for the film loop to use the
correct sprite positions (e.g. center for bitmaps), then fix the
subchannel generator to take these into account.
2021-11-09 21:46:44 +08:00
Scott Percival 6d32f570f5 DIRECTOR: Rework film loops to render as channels
The engine treats film loops as N full channels getting rendered to the
screen in the space of one. As such, it's impossible to pre-blit together
the content, as any blitter mode can be used for each of the items.
2021-11-07 12:05:29 +08:00
Scott Percival e4f767c916 DIRECTOR: Move methods from Channel to Sprite 2021-10-12 01:08:34 +08:00
djsrv 80b4d55586 DIRECTOR: Make isMouseIn return false for invisible sprites 2021-08-23 16:10:44 -04:00
ysj1173886760 8e8f640e69 DIRECTOR: fix editableText both in D2/3 and in D4. 2021-08-18 20:19:18 +08:00
ysj1173886760 000efc160d DIRECTOR: update video time when render sprites. 2021-08-13 18:03:19 +08:00
ysj1173886760 15c0c68b1c DIRECTOR: don't clear bbox when render trailed channel. 2021-08-12 17:03:09 +08:00
ysj1173886760 dcabde4f8e DIRECTOR: release previous widget when setting new castmember. 2021-08-12 17:03:09 +08:00
ysj1173886760 48934882d3 DIRECTOR: always use the unstretched dims to create widget. 2021-08-09 16:51:25 +08:00
ysj1173886760 dc6211dac0 DIRECTOR: fix the condition of resetting stopTime 2021-08-05 17:10:52 +08:00
ysj1173886760 8bc3b3c1f1 DIRECTOR: reset the _stopTime when we are not playing video. 2021-08-05 17:00:35 +08:00
ysj1173886760 12dcfbfd72 DIRECTOR: implement getting the mouseLine 2021-07-31 15:52:57 +08:00
ysj1173886760 dd7a3bfc53 DIRECTOR: implement getting the mouseItem 2021-07-31 15:47:07 +08:00