Commit Graph
30 Commits
Author SHA1 Message Date
sluicebox e23f5fe855 SCI32: Update kSetShowStyle version checks for Mac
Consolidated kSetShowStyle version/argument checks and updated them to
handle SCI2.1 Mac games and PC demos. (The demos where the wrong
arguments were being applied happened to work anyway.)

Fixes LSL7 Mac pixel dissolve at the start of the game between the
postcard and the boat (rooms 120 and 130)
2022-03-22 07:32:55 -04:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Filippos Karapetis b606509034 SCI32: Update comments concerning the kShowStyleNone change in Hoyle 5
Turns out that this was one of the interpreters where Sierra actually
changed the transition code for fading in/out, so don't mark it as a
hack anymore. Thanks to @sluicebox for his help on verifying this one
2021-10-17 20:28:09 +03:00
sluicebox 05a4e55634 SCI32: Fix color comparison typo in previous commit 2021-05-21 10:53:15 -06:00
sluicebox e09c6d13e4 SCI32: Handle kShowStyleDissolve Mac palette 2021-05-21 02:35:21 -06:00
sluicebox a92582ef0e SCI32: Translate Mac colors when drawing CelObjColor
Fixes several kSetShowStyle transitions such as the iris effect
in LSL6 Hi-res Mac at the end of the beach scene at night (room 860)
2021-05-01 14:29:18 -07:00
D G Turner d11c61db14 SCI: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-12-01 05:06:31 +00:00
Filippos Karapetis 52ff27746f SCI32: Fix fade-in for some screens in Hoyle 5 2018-08-21 03:36:07 +03:00
Colin Snover c7c5f28bdb SCI32: Clean up scriptWidth/scriptHeight/screenWidth/screenHeight
This removes the unnecessary Buffer subclass and stops most places
where the output buffer was being interrogated about dimensions
instead of GfxFrameout.
2017-10-06 22:56:26 -05:00
Colin Snover ff3503abde SCI32: Clean up GfxTransitions32
* Use containers where appropriate
* Re-wrap doxygen comments to 80 columns
* Clarify comments for parts of the engine that are understood now
  but were not understood at the time of the initial
  implementation
2017-10-06 22:10:50 -05:00
Colin Snover f59269006c SCI32: Implement kShowStyle HShutterOut transition
This transition style was used when exiting the asteroids minigame
in PQ4, though it appears likely that this was an error in the
original game script since it does not actually do anything in the
context that it is used (neither here nor in the original
interpreter).

Still, this code is already written, and it fixes the crash, so in
it goes.

Fixes Trac#9856.
2017-07-07 23:42:30 -05:00
Colin Snover e9bef89646 SCI32: Remove useless call
The show list is already cleared by showBits so it does not need to
be cleared a second time.
2017-07-06 19:12:38 -05:00
Colin Snover 9f910535c9 SCI32: Centralise OSystem screen updates 2017-07-06 19:12:35 -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 54e94c572a SCI32: Add workarounds, transitions, fixes for PQ4CD 2017-01-12 13:14:03 -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 8028b3c290 SCI32: Use standard max_size method instead of ARRAYSIZE for a container 2016-10-26 20:56:40 -05:00
Colin Snover 724385eb5e SCI32: Fix slow SCI2.1mid transitions
SSCI transitions code sends a large number of small show rects
to the graphics manager, one at a time, for each division of a
transition. Each time a rect is submitted, a call to showBits
is made. This design was used when transitions for SCI32 were
first implemented in ScummVM, and it worked OK because the
hardware surface was updated by EventManager::getSciEvent,
not showBits, so the large number of calls to showBits from the
transitions code did not adversely affect engine performance.

Later in SCI32 engine development, hardware surface updates
were changed to occur in showBits so that the hardware surface
would be updated at frame-out time, instead of at input-in time.
This change meant that now the large number of calls to showBits
from transitions became very expensive, and the engine would
stall constantly refreshing the entire hardware surface.

To fix this problem, the transitions code now (1) maximises the
size of rects coming from transitions, when possible, and (2) only
calls showBits when all the rects from one frame of a transition
have been calculated and added to the show rects list.

Additionally, there were some arithmetic errors in the
implementation of pixel dissolve that have been corrected in this
changeset.

Fixes Trac#9614.
2016-10-22 13:18:38 -05:00
Colin Snover 90c2f77686 SCI32: Implement HShutterIn for SCI2.1mid+
Fixes Trac#9584.
2016-10-21 21:04:01 -05:00
Colin Snover 8c555200d9 SCI32: Change storage type of int16 arrays to hold reg_ts instead
Memory references and integers in SSCI are both 16-bit numbers,
so game scripts frequently (incorrectly) use an IntArray instead
of an IDArray for holding references. Since references in ScummVM
are 32-bit reg_ts, IntArray entries must be large enough to hold
reg_ts in order to be compatible with game scripts that store
references in integer arrays.

The alternative solution is to find and patch all incorrect use of
IntArray across all games. This is possible, but a bit risky from
a save game stability perspective, since incorrect IntArray usage
is sometimes not apparent until well after the array is
instantiated (like GK1's global interview array).

This change invalidates existing SCI32 save games.
2016-10-09 11:21:13 -05:00
Colin Snover cf07e0cb7c SCI32: Ensure break to debugger works during transitions 2016-09-29 19:39:16 -05:00
Colin Snover 3f91726765 SCI32: Rewrite kArray & kString
This change invalidates earlier SCI32 save games, which separated
arrays and strings in an incompatible manner. Old save games
contain invalid references to a string segment which no longer
exists, and contain incompatible array structures that lack
critical type information.
2016-09-29 19:39:16 -05:00
Colin Snover 63345b2b70 SCI32: Fix kShowStyleNone transitions 2016-09-29 19:39:16 -05:00
Colin Snover 181676a0d5 SCI32: Fix memory leak
CID 1361032.
2016-09-29 19:39:16 -05:00
Colin Snover 327f8f8299 SCI32: Fix potential null pointer dereference
CID 1361026.
2016-09-29 19:39:16 -05:00
Colin Snover 2fcec86696 SCI32: Fix typo
CID 1361007.
2016-09-29 19:39:16 -05:00
Colin Snover 7f23c91de9 SCI32: Fix limited data range comparison warning
On at least DC platform, the ShowStyleType enum is fit to a 4-bit
data size, so the 16-bit input value needs to be checked for
validity *before* it is cast to a 4-bit ShowStyleType.
2016-08-19 15:23:10 -05:00
Colin Snover 10f9cb7023 SCI32: Fix crash when destroying GfxTransitions32 2016-08-01 10:37:14 -05:00
Colin Snover 2071196f42 SCI32: Add bitmap segment and remove GC option from hunk segment 2016-08-01 10:37:14 -05:00
Colin Snover 156c68fe58 SCI32: Implement plane transitions (kSetShowStyle and kSetScroll)
This commit implements all of the known plane transitions from
SCI2 through SCI2.1mid games. Because kSetShowStyle is always
called indirectly via the Styler game script, it is difficult to
find all the places where transitions are used. As such,
transitions that appeared to never be used have been added as
stubs which will trigger a game crash with a message to report
what was being done, so any missed transition types can be
identified quickly and then implemented.
2016-08-01 10:37:14 -05:00