Commit Graph
1475 Commits
Author SHA1 Message Date
Colin Snover ee4b172d54 SCI: Remove old SCI32 hires detection heuristic 2016-11-02 15:43:07 -05:00
Colin Snover e8c429832f SCI32: Automate kNumCels workaround 2016-11-02 15:43:07 -05:00
Colin Snover c42e74c562 SCI32: Remove incorrect palette.h #include 2016-11-02 11:27:22 -05:00
Colin Snover 73725bab07 SCI32: Fix AVI rendering
Fixes Trac#9588.
2016-10-26 20:56:40 -05:00
Colin Snover 4044ed5b6f SCI32: Initialize video buffers to avoid flash of garbage memory 2016-10-26 20:56:40 -05: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 45f7aef8cb SCI32: Fix typo 2016-10-20 11:33:29 -05:00
Colin Snover 34bd1bcaa9 SCI32: Split out detection of features that cross SSCI versions 2016-10-20 11:33:29 -05:00
Colin Snover a854c7e274 SCI32: Fix screen items incorrectly drawing over higher planes
Fixes Trac#9583.
2016-10-16 21:21:13 -05:00
Colin Snover 4b6b328bbb SCI32: Check for existence of visiblePlane before dereferencing
CID 1351620.
2016-10-10 19:35:28 -05:00
Colin Snover 6cc761e728 SCI32: Allow 'focused' variable to break out of the event loop 2016-10-09 11:41:52 -05:00
Colin Snover 40444b0aeb SCI32: Clarify some identifiers
transparentColor -> skipColor
displace -> origin
scaledWidth -> xResolution
scaledHeight -> yResolution
2016-10-09 11:21:46 -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
Eugene Sandulenko dead4aa014 JANITORIAL: Remove trailing spaces 2016-10-09 14:59:58 +02:00
Colin Snover ab88597a4a SCI32: Make kNumCels error more detailed 2016-10-01 15:26:34 -05:00
Filippos Karapetis 437f1d1cd1 SCI32: Add the rest of the code from PR #813 for dynamic line drawing 2016-10-01 00:25:06 +03:00
Colin Snover 5baff4a1e5 SCI32: Fix some buildbot compiler warnings 2016-09-30 13:54:06 -05:00
Colin Snover b7f93623c4 SCI32: Fix broken palette cycling in SCI2/2.1early games
This fixes the incorrect appearance of the Sierra logo in PQ4 when
the main menu appears in hi-res mode.

The behaviour of kPalCycle(SetCycle) changed in between 2.1early
and 2.1mid to fix an off-by-one error that prevented the last
palette entry in a cycle range from being used. Some earlier games,
like PQ4CD in hi-res mode, relied on this behaviour, and would
render incorrectly if the last palette entry in a range was used.
2016-09-29 19:39:16 -05:00
Colin Snover e412eaffbc SCI32: Clean up and document GfxPalette32 2016-09-29 19:39:16 -05:00
Colin Snover 7ad9418583 SCI32: Fix off-by-one error in palette fades 2016-09-29 19:39:16 -05:00
Colin Snover 8fd19f84c8 SCI: Deduplicate call origin formatting 2016-09-29 19:39:16 -05:00
Colin Snover 6290f1e5fc SCI: Add prefix to global variable constants 2016-09-29 19:39:16 -05:00
Colin Snover 43f908d68b SCI32: Break into debugger after frameout, not before 2016-09-29 19:39:16 -05:00
Colin Snover cf07e0cb7c SCI32: Ensure break to debugger works during transitions 2016-09-29 19:39:16 -05:00
Colin Snover 2035e21667 SCI32: Add workaround for kNumCels
This workaround may be able to be vastly simplified in the future
since, so far, simply returning the number of cels in loop 0 is
enough to make all the scripts with this bug work as expected.
2016-09-29 19:39:16 -05:00
Filippos Karapetis a8009fb0a9 SCI32: Fix crashes in line drawing code
Fixes Torin room 43000.

The algorithm in Graphics::drawThickLine2 for drawing thick lines
is not completely accurate and so there are still some single-pixel
rendering bugs, but these do not impact the game itself and can
be fixed separately.
2016-09-29 19:39:16 -05:00
Colin Snover 3208f063b5 SCI32: Extra bounds checking in CelObj renderer 2016-09-29 19:39:16 -05:00
Colin Snover 9a64c0587b SCI32: Always build scaler tables to the maximum possible size
This fixes rendering errors in Torin caused by the scaler table
being cut off early when cels larger than the dimensions of the
screen are scaled.
2016-09-29 19:39:16 -05:00
Colin Snover 2a27f27bb4 SCI32: Clean up scaling flags 2016-09-29 19:39:16 -05:00
Colin Snover cb66bfead0 SCI32: Fix CelObj scaling in games with hi-res scripts 2016-09-29 19:39:16 -05:00
Colin Snover b5d0fffb8b SCI: Replace magic numbers for globals with named constants 2016-09-29 19:39:16 -05:00
Colin Snover 44dd029cb1 SCI32: Implement kSetHotRectangles
Used only by chapter 7 of Phant1.
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 240b0ca348 SCI32: Add a trap for invalid calls to kNumCels 2016-09-29 19:39:16 -05:00
Colin Snover 3201440d11 SCI: Generalize code for getting information on the current call 2016-09-29 19:39:16 -05:00
Colin Snover 84d8ac4c38 SCI32: Fix buffer overflow when drawing border to a tiny text bitmap 2016-09-29 19:39:16 -05:00
Colin Snover 658fb7f8e4 SCI32: Improved game resolution detection 2016-09-29 19:39:16 -05:00
Colin Snover 39a3b67522 SCI32: Skip SEQ playback if file not found
CID 1361588.
2016-09-29 19:39:16 -05:00
Colin Snover 209fe0f92a SCI32: Fix incorrect use of speedThrottler in Video32
The sleep values for video playback are the amount of time until
the next frame needs to be displayed, whereas speedThrottler is
used to ensure that a given amount of time always elapses between
two triggered speedThrottler calls.
2016-09-29 19:39:16 -05:00
Colin Snover 3cf16c0a7f SCI32: Explicitly instantiate MIN/MAX templates 2016-09-29 19:39:16 -05:00
Colin Snover d0517f515e SCI32: Update screen on frameout, instead of in the event loop 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 4d3752f9af SCI32: Fix potential null pointer dereference
CID 1357041.
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 5ab363a436 SCI32: Fix potential null pointer dereference
CID 1351620.
2016-09-29 19:39:16 -05:00
Colin Snover bfbbee8697 SCI32: Fix rendering of non-ASCII characters 2016-08-28 19:33:21 -05:00