Commit Graph
1475 Commits
Author SHA1 Message Date
Colin Snover c02f2674ad SCI32: Add debugging calls to GfxCursor32
Refs Trac#9740.
2017-05-01 20:44:25 -05:00
Colin Snover 5dd9618842 SCI32: Remove unnecessary GfxFrameout::_frameNowVisible
This flag was used in SSCI to read from VRAM instead of from the
back buffer when a mouse interrupt was received in the middle of
a back buffer update. Since ScummVM controls when mouse events
are received via polling, it is not possible to receive a mouse
event in the middle of back buffer updates, so this code is
unnecessary for the engine to work properly.

This also fixes Valgrind warnings about use of uninitialized
memory at the start of the game, caused by not filling the cursor
memory buffers because `_frameNowVisible` was false until the first
frame was rendered.
2017-04-29 14:31:01 -05:00
Colin Snover f3db412d6f SCI32: Serialize Robots in SCI3
This is necessary for at least Lighthouse, which maintains the
state of Robots across save games.
2017-04-23 13:07:25 -05:00
Colin Snover 88f020c7d4 SCI32: Fix out-of-bounds reads of truncated uncompressed cels
This happens e.g. on the About page in LSL7 because of an
interpreter problem where bitmap handles are destroyed and then
reused without a kFrameOut call to remove old screen items from
the visible plane list before a kIsOnMe call that causes the
engine to try to read from reused bitmap handles with different
contents and dimensions.

This replaces bad memory reads on the About page in LSL7 with an
assertion failure, until the problem with the About page can be
properly addressed.
2017-04-23 13:07:25 -05:00
Colin Snover 4d9b019b18 SCI32: Activate SCI3 draw/erase list calculation algorithm
This code branch, existing since at least SQ6 but apparently never
used by any SCI2/2.1 game, is in fact the algorithm used by SCI3.

This fixes (at least) doubled rendering of transparent surfaces
like the background of the inventory window and conversation
choices panel in LSL7.
2017-04-23 13:07:25 -05:00
Colin Snover 09fea5f108 SCI32: Fix bad draw rectangle size in Duck video player
This was causing uninitialised garbage data from the scale buffer
to be drawn to the screen.
2017-04-23 13:07:25 -05:00
Colin Snover b8f0224b62 SCI32: Remove unused SegManager from DuckPlayer 2017-04-23 13:07:25 -05:00
Colin Snover 168774c3c6 SCI32: Add kPlayVMD subop 27 (SetPlane)
Used by RAMA, when playing a video at the Hub Camp computer at the
beginning of the game (room 1004).
2017-04-23 13:07:25 -05:00
Colin Snover c88a43b615 SCI32: Reset ScreenItem cel type when updating from a VM object
In Phant2, when going to email on Curtis's office computer, a
screen item that contained a bitmap on the last frame was updated
to contain a view on the next frame. This crashed the engine when
it tried to reuse the old disposed bitmap instead of the new view
because the cel type was never changed from kCelTypeMem to
kCelTypeView.
2017-04-23 13:07:25 -05:00
Colin Snover 78fd8d39c5 SCI32: Disable brightness boost when black-lined video is disabled
The boost is intended to compensate for the darkness caused by the
black lines, so should not be applied when there are no black
lines. This fixes too-bright videos in at least LSL7.
2017-04-22 19:38:13 -05:00
Colin Snover 16fe6d3cb1 SCI32: Store handle to VMD bitmap separately from ScreenItem
In at least RAMA, when using the pocket computer to view a mail
and then pressing the "return" button, the ScreenItem containing
the VMD will be destroyed before the VMD player is told to close
the video, resulting in a use-after-free trying to access the
bitmap ID through the deleted ScreenItem.
2017-04-22 19:38:13 -05:00
Colin Snover 8a5eb0c784 SCI32: Fix dumb typo in CelInfo32::toString
The typo was `if (kCelTypeColor)` instead of
`if (type == kCelTypeColor)`. Changed to use a switch instead for
improved clarity and code intelligence.
2017-04-22 19:28:36 -05:00
Colin Snover 8105984703 SCI32: Fix broken final step of 2.1mid+ pixel dissolve 2017-04-22 19:25:20 -05:00
Colin Snover ede7976ede SCI32: Fix bad kPointSize implementation
Fixes text scaling gone mad in Phant2.
2017-04-22 19:25:20 -05:00
Colin Snover e504efe4da SCI32: Add palette code for late SCI2.1mid+ games
Sometime during SCI2.1mid, the palette manager was changed to
save and restore the source palette, and to add in-game gamma
correction. Previously, only the vary start and target palettes
were saved, and gamma correction was only configurable in SSCI by
editing RESOURCE.CFG.
2017-04-22 13:01:37 -05:00
Colin Snover c8486395fa SCI: Clean up unnecessary delayed restore flags
_delayedRestoreGame is always set and cleared at the same time as
_delayedRestoreGameId, and _delayedRestoreFromLauncher is written
but never read.
2017-04-22 13:01:35 -05:00
Colin Snover ec12c5a342 SCI: Move ScummVM save/restore to GuestAdditions and reimplement for SCI32 2017-04-22 13:01:16 -05:00
Colin Snover 739047f887 SCI32: Always reinit GfxText32 statics on game startup
Fixes bad scaling of text when switching between games with
different script resolutions.
2017-03-30 19:46:27 -05:00
Colin Snover 4c942758c0 SCI32: Use built-in system font as default font for GfxText32
Fixes the non-interactive Lighthouse demo.
2017-03-30 19:46:27 -05:00
Colin Snover 766d46153a SCI32: Implement known-used portions of kPlayDuck 2017-03-30 19:46:27 -05:00
Colin Snover a233696212 SCI: Update formatting strings to match updated Span API 2017-03-30 14:23:41 -05:00
Colin Snover 532828c143 SCI: Remove old SCI32 check from SCI16 drawing code 2017-03-27 19:42:31 -05:00
Colin Snover 6600fb77ea SCI: Use containers in GfxView and remove some SCI32 code 2017-03-27 19:42:31 -05:00
Colin Snover 31daa956d6 SCI: Implement bounds-checked reads of game resources 2017-03-27 19:42:31 -05:00
Colin Snover 10d97ce379 SCI: Fix more unsafe C-string usage 2017-02-05 12:38:21 -06:00
Colin Snover 600a9127de SCI32: Add pic cel to CelInfo32 debugging output 2017-01-16 12:16:14 -06:00
Colin Snover d9de55b2a9 SCI32: Fix handling of negative z-indexes
Fixes the ego disappearing behind the castle doors in MGDX.
2017-01-16 12:16:14 -06:00
Colin Snover efa6b74cce SCI32: Clarify comment about empty code path in cursor code 2017-01-16 12:16:13 -06:00
Colin Snover ba50f88a3c SCI32: Fix crash trying to clip invalid rects generated by transitions
In PQ4CD, when leaving the shooting range through the front door,
some transition screen items will be generated that have invalid
dimensions. SSCI simply clips these rectangles to zero.
2017-01-12 13:16:53 -06:00
Colin Snover dd13fdfe17 SCI32: "Fix" renderer for PQ4CD
PQ4CD and several other games contain a hack in two renderer
methods to avoid rendering invalid screen items with zero or
negative-dimension target rects. This prevents PQ4CD from
crashing during the fifth phase of target practice.
2017-01-12 13:14:10 -06:00
Colin Snover 54e94c572a SCI32: Add workarounds, transitions, fixes for PQ4CD 2017-01-12 13:14:03 -06:00
Colin Snover 320d6c8255 SCI32: Fix uninitialised read of cursor background at start of game 2017-01-11 12:02:12 -06:00
Colin Snover 7156a82a64 SCI32: Improve mouse responsiveness
This is most noticeable at the beginning of the game during
benchmarking, where the benchmarking loop used to cause the mouse
to get stuck for the duration of the benchmark.
2017-01-11 11:01:38 -06:00
Colin Snover 126378fa26 SCI32: Fix bad coordinates in PQ:SWAT demo 2017-01-09 19:34:54 -06:00
Colin Snover c8b05f03ad SCI32: Fix invalid bitmap deletion in AVIPlayer 2017-01-09 19:34:54 -06:00
Colin Snover b818e54027 SCI32: Fix crashes and bad cel positioning in GK2 demo 2017-01-09 19:34:54 -06:00
Willem Jan Palenstijn 95ab3bece9 SCI: Add FIXME for (very unlikely) race condition in _palVarySignal 2017-01-06 19:03:50 +01:00
Colin Snover a91b432cdb SCI32: Load VMDs from resource bundles
GK2 includes some VMDs in the RESSCI.00n volume bundles for the
chase scene at the end of Chapter 6.
2017-01-02 17:02:31 -06:00
Colin Snover 2eadb3e924 SCI32: Improve ScreenItem missing resource error 2016-12-19 14:46:59 -06:00
Colin Snover 4cff1e400f SCI32: Add support for alternate graphics selectors
Used by at least Phantasmagoria 2.
2016-12-19 14:46:59 -06:00
Colin Snover ba619a08dd SCI32: Change plane and screen item sorting algorithm
SSCI's last resort comparison here was to compare the object IDs
of planes & screen items, but this randomly breaks (at least) the
"you have died" dialog at the end of Phant1, and text & buttons
in Hoyle5, even in SSCI itself.

This commit changes last resort comparison to use a monotonically
increasing ID instead, which keeps objects with identical priority
& z-index in creation order when compared.

Fixes Trac#9585.
2016-12-19 14:46:58 -06:00
Colin Snover 6412b32386 SCI32: Fix incorrect parsing of empty |f| text escape code
This sequence is used in Hoyle5 when viewing the rules for a game.
2016-12-19 14:46:46 -06:00
Colin Snover 6338496dff SCI32: Fix bitmap surface memory leaks in video players
Fixes Trac#9662.
2016-12-17 18:55:23 -06:00
Colin Snover 4b4b8a281b SCI32: Adjust transition timings
Transition timings were originally chosen largely by feel in SQ6,
as there was little other evidence to determine the correct speed.
As additional games started being playable in ScummVM, it became
apparent that these speeds were not quite right.

Additional adjustments may be needed in the future, but these new
timings seem to be somewhat closer to expectations than before.
2016-12-12 15:22:11 -06:00
Colin Snover 22398e571b SCI: Fix buffer overflows in GfxPicture circle drawing
Fixes Trac#9660.
2016-12-10 19:34:19 -06:00
Colin Snover 1af7fe8b96 SCI32: Remove no-longer-necessary Phant1 VMD sync hack 2016-11-19 19:06:04 -06:00
Colin Snover 2eea7dc961 SCI32: Implement kPlayVMDIgnorePalettes
Used in Shivers room 35170 when pressing the play button.
2016-11-04 20:45:45 -05:00
Colin Snover 4bfd005c78 SCI32: Stop digital audio when VMDs open in some SCI2.1 games 2016-11-04 20:10:21 -05:00
Colin Snover fda89a9f59 SCI32: Fix VMD playback stuttering when kEventFlagToFrame is used
For example, Shivers room 932 when subtitles are enabled.
2016-11-04 15:16:10 -05:00
Colin Snover e4b8820762 SCI32: Fix incorrect text width calculation of non-ASCII strings
Fixes Trac#9639.
2016-11-02 21:45:44 -05:00