Previously, film loops were incremented from Score::updateSprites() by
Channel::setClean(), however this wasn't guaranteed to be run only once
per frame and lead to animation frames being skipped.
This has now been moved into Score::renderFrame.
According to the Director documentation, "play" acts in a very different
way to "go". Instead of freezing execution of the handler as part of the
stack, it will freeze the handler and defer it until "play done" is
called by something else. This adds a method for doing this, plus
workarounds to not impact the event processing pipeline.
Fixes picking up most of the time trumpets in Virtual Nightclub
(1580:winASWarp in shared.dxr).
The findPath() utility function is requesting g_director->getCurrentPath(),
and that one is calling _currentWindow->getCurrentPath(). With side-loading
of movies in different path, it was still trying loading shared cast
from the current movie directory.
Before that, we were only _scheduling_ the movie to load, which
was leading to movie actually getting loaded only after the
current script is over.
This affects jewels1 boot process, where the following Lingo is used:
set myWindow to window "puzzle"
set the fileName of myWindow to "NAVLOAD"
open(window "puzzle")
tell window "puzzle"
waitSignal()
end tell
As a result, tell() was complaining about unknown waitSignal handler
because it has not yet been loaded.
Now, after splitting loading and Lingo execution into separate phases,
we can truly only load a movie without messing with scripts (yet).
- Split out "Loaded" state for score
- Added two debugflags: paused, to start in paused mode and
paudeonload, to pause every movie when it is loaded
- Use OSD for reflecting paused state
Previously if there was a movie switch, and the two movies used
different custom palettes with the same cast ID, there was no
mechanism to force a swap to the new palette.
Fixes palette glitches in Die Hexenakademie.
The Mask ink type allows Director to combine a sprite with a 1bpp
mask bitmap to stencil an image. Previously we were using the widget
drawing code to generate this image, which caused issues with scaling
and depth (as the surface was formatted to match the screen). The new
code checks for a 1bpp image specifically and sends it through, removing
the workarounds for screen depth.
Fixes the drawing of the welcome cube at the start of Virtual Nightclub.
The new bounding box calculation requires the transformed position/size
to be in Sprite, not Channel.
Fixes the visibility of the boar hunt in Wrath of the Gods.
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 was incorrectly implemented as matching the Window name, because
of short-sighted implementation.
This fixes startup in jewels1, where it creates a separate window
named "puzzle", assigns a filename to it but still continues referring
to the window as "puzzle".
- Add guardrails to m_forget
- Treat g_director->_currentWindow as a reference-counted copy
- Move MacWindowManager cleanup out of ~Datum into Window::decRefCount
This patch fixes the behaviour of windows when setting their
properties (e.g. titleVisibility, Modal, etc) from the lingo.
Initially the window was set to be visible when the property was
set, but this is not the expected behaviour. The window should
only be visible when the `open` command is called. Removed `setVisible(true)`
from various window properties assignment functions.
Fixes popupmenu overlay in `meet-mediaband` and white rectangle when
opening `mcluhan-win`.
--start-movie="main\stvimenu.dxr" mediaband-win
In the original engine, the enterFrame handler can only be called
recursively upto second depth, and the third call will be ignored.
This was formerly implemented by counting number of frozen lingo
states, however there are cases where the lingo state is frozen,
while enterFrame handler not called, so the count is not accurate.
This patch improves the logic by counting the number of enterFrame
in frozen lingo states as well, so it can be identified that these
previous frames are indeed of `enterFrame` handler.
Fixes bug where the elevator when jumping to next floor (yellow one)
broke dimensional movement in `totaldistortion-win`.
When changing from shared casts in `Window::loadNewSharedCast`, and in
instance where previousCast need to be deleted, we just deleted the cast
itself but not the underlying `Archive`, this resulted in memory leaks.
`~Director()` was not deleting this archive because it was being removed
from `_allSeenResFiles` in favour of loading new archive.
Fixed by deleting `Archive *_castArchive` of previousCast after erasing
its entry from `_allSeenResFiles`.
When reloading the shared cast, erase the references from both
_allSeenResFiles and _allOpenResFiles. In the case that the shared
cast is reloaded from a different path, this would leave a dangling
reference in _allOpenResFiles. This would then lead to a crash later
when enumerating _allOpenResFiles and trying to access the found
path in _allSeenResFiles.
Fixes a crash in the D4 version of Alice which would occur when loading
the cursor. This occurs since Alice ends up loading first Shared.dir and
then DATA:Shared.dir, leaving a dangling reference to Shared.dir in
_allSeenResFiles.
Issue was introduced in 9aa0958736.
Normally Director will look for a movie of the same name as the window,
however with `the fileName` property, it can assign name of movie to be
played in the window.
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.
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().
Implements modal property using the locking widgets of macwindowmanager.
`modal of window` in 'workshop' uses this.
Co-authored-by: Pragyansh Chaturvedi <pragyanshchaturvedi18@gmail.com>
Modifies border of window by first changing title to "", then updating
window border to borderType 2 `ThinNoTitle`.
`titleVisible of window` to verify this behavior.
Co-authored-by: Pragyansh Chaturvedi <pragyanshchaturvedi18@gmail.com>
Adds the support to get/set field 'rect' of window object, interally it modifies the inner dimension of window object.
'mcluhan' used this to set window dimensions of background windows (through tell), Additionally `rect of window` in `workshop` also uses this patch for setting/getting field `rect` of window.
resize function is extracted to new function resize and resizeInner,
also a new private function rebuildSurface is created to handle common
code of refreshing/rebuilding surface after modifying inner or outer
window dimensions.
No longer needed, the scaling should happen when updating the widget.
Fixes adjusting sprites with Lingo, such as in DEVO Presents:
Adventures of the Smart Patrol.
These days we are checking path validity in Window::setNextMovie(),
thus, forcing _currentPath leaded to inability to load movies from
root when called from within a subdirectory.
Fixes alice-win