* DIRECTOR: Fix warning about usage of ABS()
* DIRECTOR: Remove MSVC-specific argument size modifier prefix from imgui
The I (uppercase i) modifier is a Microsoft extension, and is not ISO
compatible. MSVC supports the z modifier, which is ISO compatible, so
use that everywhere inside the ImGui code.
The relevant MSVC documentation can be found here:
https://learn.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions?view=msvc-170
* DIRECTOR: Fix assigning negative value to string end position
Most of the time we'll be looping to the same frame, where we want
to update the sprites, but not clobber them with the contents of the
current frame.
Fixes the paint splodges on the easel in the A room of Cyber Grannies.
Fixes the menu system in Cosmology of Kyoto.
After a script reaches "play done", that script gets aborted.
The Lingo frozen play script (aka the script that initially invoked
play) will be thawed before stopMovie.
Fixes director-tests/D4-unit/T_PLAY01.DIR.
Fixes movie switching in Cyber Grannies.
If called at the start of the movie, marker would return
the second-nearest marker.
Fixes the Kroll jumping about forever on the second loop of the Spaceship
Warlock demo.
As discussed in Discord, in PR#5998 and other places, we can just use PRId64
from <inttypes.h> as a reliable way of printing int64 values on all
platforms, now that this header is guaranteed to be available everywhere.
Fixes build warnings on some 64-bit platforms, which were introduced by my
own previous commit 6ce2ba98f8.
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).
Previously there was a gap between loading a new frame, and copying the
sprite information from that new frame back to the channels (if
required). Scripts could run in this gap, and in this case they would
be operating on the old sprite information instead of the new.
Score::renderFrame has been renamed to Score::updateFrame; the method
doesn't actually render anything, it reconciles the difference
between the frame data and the channel data, updates the channel data,
and produces a list of dirty rects.
Fixes the menu screen of Majestic: Alien Encounter.
Fixes director-tests/D4-unit/T_SPRT02 and T_SPRT03
It is possible to call "pause" in the exitFrame handler, then rely on
another handler (e.g. mouseDown) to call "continue" to start the movie
playback. exitFrame should not be called again once playback is resumed.
Fixes entering the first hatch in L-Zone.
Fixes D4-unit/T_EVNT12.DIR in director-tests.
The original logic doesn't hold up to testing. The position/width/height
of a sprite can be changed at any time without any extra flags; although
the screen needs to be redrawn before you can see any change.
The main thing that the sprite puppet flag does is determine if sprites
are updated from the score data when the frame changes.
Fixes the broken mouse cursor tracking sprite in Chop Suey.
Fixes the sprite scaling in the Doc Martens minigame in Virtual
Nightclub.
Fixes director-tests/D4-unit/T_SPRT01.DIR
If you trigger e.g. a mouseDown and a mouseUp event, the mouseUp event
should not be run until the mouseDown event has returned.
Fixes director-tests/D4-unit/T_EVNT03.DIR
The startMovie handler needs "the frame" to return the starting frame,
which isn't necessarily 1. Easiest way to fix this is to set up the
frame data in the Score::startPlay() handler.
Fixes the broken navigation in the Empire State Building in Hell Cab.
Sprites in a score frame have a width and a height; it appears these
values are only to be used if the "stretch" flag is set. Otherwise, the
cast dimensions are used.
Fixes the scaling when picking up the photo album from the filing
cabinet in P.A.W.S.
With D2/D3 action and movie scripts, if there is a syntax error,
the compiler seems to truncate the script at the first unreadable
character, then attempt to compile again.
Fixes the machine gun minigame in Hell Cab.
Playing two digital videos back to back in the same channel was not
working; both videos thought they controlled the channel, which meant
that the first video would complete, then set _movieRate in the channel
to 0, which would then be misinterpreted by e.g.
Score::isWaitingForNextFrame() as a sign that the second video had
finished.
Fixes the introductory videos in Eastern Mind.
Fixes the conversation with the two ladies at the river in Wrath of the
Gods.
Previously, volume changes would only be picked up by the next sound
started in the channel (if at all).
Fixes the hint music clashing in the fortune teller floor of the
department store and Club Exclaim in The Seven Colors.
Previously the puppetSound flag condition would only be disabled if the
sound was playing at the time of the movie switch.
Fixes music when entering the cat room straight from the start room
in The Seven Colors.
Several Director titles make use of the "trails" sprite feature to
draw graphics to the framebuffer, strobing multiple sprites with a
single channel. In order for this to work, we need to be careful that
the dirty rectangles list is only updating the bare minimum area.
Extra rectangles were being added by Score::renderSprites; an invalid
cast reference would still add the channel's bbox to the list. This has
been fixed.
Previously, the end of a transition would force a full screen refresh,
even if the update was partial. This should be unneccesary; transitions
shouldn't leave artifacts on the screen.
Fixes many instances of inventory items disappearing in Team Xtreme:
Operation Weather disaster (e.g. clicking the compass in Stonehenge,
clicking an item on the memory game in Stonehenge).
Confirmed to work with:
- darkeye (race condition when viewing cutscenes or switching scenes in
the menu)
- gadget (race condition after climbing the stairs in GA28)
- the7colors (intro cutscene timed with b_delay)
- wallobee (hotspot select gated with b_delay)
It is unclear what problem it was intended to solve, but it no longer
works now that 04cd1dccf9 has fixed the
frame loader to not reload if the frame hasn't changed.
Fixes movie playback in The Dark Eye.
When `Score::loadFrame(frameNum)` is called with frameNum <=
_curFrameNumber it will start by resetting frame state, then loading
previous n-l frames and then updating `_curFrameNumber to` `frameNum`.
This is by design, to allow abribtrary script-based frame jumping and debug console commands.
Previous to this change `Score::update()` incrementing `_curFrameNumber` directly before
calling `Score::loadFrame(_curFrameNumber)`. In effect, this meant that
every time the playhead moved forward one frame, all previous frames
would first be loaded from the stream first. Any state built
up by previous scripting is lost and perhaps impacts performance at
suitably high frame counts and debug levels.
In this change, `Score::update()` instead makes changes to a local
variable and passes the result to `Score::loadFrame()`.