Commit Graph
48 Commits
Author SHA1 Message Date
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Filippos Karapetis bd7e708fc3 SCI: Move resource related functionality into a separate folder 2020-11-29 14:34:55 +02: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
sluicebox 6884349534 SCI32: Fix Mirrored Pic Drawing
Fixes bug #10748
2019-08-11 18:55:10 +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 0ac5d84062 SCI32: Clean up ScreenItem
* Rewrap comments to 80 columns
* Clarify comments where possible
* Use smart pointers where appropriate
2017-10-06 22:10:50 -05:00
Colin Snover b2966f3fc8 SCI32: Fix support for RAMA demo
Fixes Trac#10251.
2017-09-30 01:08:12 -05:00
Colin Snover 3cdf26b355 SCI32: Fix bad text rendering in RAMA
In SCI3, Sierra removed the ability of the main renderer to
automatically scale CelObjs with different source resolutions.
Instead, in SCI3, all CelObjs are treated as having the same
resolution as the screen (i.e. 640x480).

In all SCI3 games other than RAMA, keeping the code paths for
resolution-dependent scaling is not a problem because all the
assets and game code are correctly designed to use the same
640x480 resolution throughout. RAMA, on the other hand, was
written with the text subsystem set to a resolution of 630x450
(Phant1's screen resolution), and in SSCI, resolution-dependent
scaling code was not removed from the *text* subsystem. As a
result, RAMA's game scripts rely on the slightly larger scaled
dimensions coming out of the text system when determining the size
of screen items for rendering, and then also rely on the main
renderer ignoring the 630x450 resolution baked into the bitmaps
generated by the text subsystem when drawing them to the screen.
2017-09-29 19:56:24 -05:00
Colin Snover 200c8c442b SCI: Remove dead code 2017-09-10 22:17:17 -05:00
Colin Snover 6ad230da7c SCI32: Fix kIsOnMe crashes in LSL7 About screen 2017-07-18 12:35:06 -05:00
Colin Snover f940346812 SCI32: Minor cleanup to plane debug information 2017-05-27 23:36:11 -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 31daa956d6 SCI: Implement bounds-checked reads of game resources 2017-03-27 19:42:31 -05: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 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 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 40444b0aeb SCI32: Clarify some identifiers
transparentColor -> skipColor
displace -> origin
scaledWidth -> xResolution
scaledHeight -> yResolution
2016-10-09 11:21:46 -05:00
Colin Snover 2a27f27bb4 SCI32: Clean up scaling flags 2016-09-29 19:39:16 -05:00
Filippos Karapetis 511d9f1e40 SCI32: Fix crash in Torin, chapter 4, catapult scene (via ScreenItem)
loopNo/celNo are set to unsigned integers in ScreenItem::setFromObject
in SSCI, thus their value will be adjusted when it's negative, like in
this case
2016-08-23 15:52:54 +03:00
Colin Snover b6dbc79021 SCI32: Add support for blacklined video
Ow. My eyeballs.
2016-07-10 09:36:10 -05:00
Colin Snover 6c8661d144 SCI32: Fix bad rendering of subtitle backgrounds in Torin
The way dimensions of scaled screen items are calculated changed
over the lifetime of SSCI. In early low-resolution and
mixed-resolution games, scaled drawing needed to use at a global
cadence across the entire screen to ensure proper alignment, but
in later games (like Torin), local scaling of individual screen
items seems to be the way scaling is performed.
2016-07-01 15:54:27 -05:00
Colin Snover 0310b4dc4d SCI32: Implement engine-accurate screen item list sorting
It seems highly probable that there are later SCI games that use
the "hi res" rendering path, so sorting and unsorting of
ScreenItemLists needs to be accurate.
2016-06-30 14:04:57 -05:00
Colin Snover 29f7a66af4 SCI32: Add low resolution constants
In a few places in the graphics system, fixed low-resolution values
are used instead of the game script resolution.
2016-06-30 14:04:56 -05:00
Willem Jan PalenstijnandColin Snover ab864ba366 SCI32: Implement kScrollWindow
These should be all the actually used subfunctions.

Co-authored-by: Colin Snover <github.com@zetafleet.com>
2016-06-21 08:14:12 -05:00
Colin Snover a613a27b44 SCI32: Implement line drawing (kAddLine/kUpdateLine/kRemoveLine)
This line drawing code lives in a remodelled GfxPaint32 class
that is totally separate from GfxPaint16.
2016-06-21 08:14:12 -05:00
Colin Snover 371b50e75a SCI32: Add explicit checks for null pointers
CID 1351617, 1351618, 1351619, 1351620, 1351621, 1351622, 1354791.
2016-05-27 19:20:22 -05:00
Colin Snover 4ee5b0f910 SCI32: Use better name for fixed priority field
The old name matches the selector, but isn’t as clear.
2016-05-27 15:54:14 -05:00
Colin Snover e25d928a9c SCI32: Fix crashes in kIsOnMe caused by stale CelObjs 2016-03-18 13:08:37 -05:00
Colin Snover ee8615d6b1 SCI32: Clarify the purpose of scaling ratios used in ScreenItem 2016-03-13 12:45:59 -05:00
Colin Snover 695e5db9a7 SCI32: Remove side-effect-abusing calls to ScreenItem::getCelObj 2016-03-10 14:16:56 -06:00
Colin Snover 4a16ebc970 SCI32: Implement kSetNowSeen 2016-03-10 14:16:56 -06:00
Johannes Schickel 693f8dc295 SCI: Add missing namespace comments in graphics/. 2016-03-08 20:13:05 +01:00
Colin Snover a2e9cc4965 SCI32: Clean up kIsOnMe and fix rounding bug
The implementation was not correctly rounding the scaled position
with mulru, leading to occasionally incorrect hit detection at
the boundaries of boxes.
2016-03-08 10:29:05 -06:00
Colin Snover 36800b7017 SCI32: Fix memory leaks 2016-03-06 21:34:43 -06:00
Colin Snover e8d6ad1d0b SCI32: Fix missing digits in plane item list debug output 2016-03-06 21:34:43 -06:00
Colin Snover 1337cd3dec SCI32: Implement kEditText 2016-03-06 21:34:43 -06:00
Colin Snover 97d5e92185 SCI32: Review rect rounding in Plane and ScreenItem
These changes should cause ScummVM to be more accurate in edge
case rounding.
2016-03-02 00:01:13 -06:00
Willem Jan Palenstijn 154f592f51 SCI32: Clear InfoFlagViewVisible after updating ScreenItem 2016-02-27 14:21:23 +01:00
Filippos Karapetis 93e99ba30d SCI: Remove a TODO in GK1 that has been resolved properly now 2016-02-27 14:40:13 +02:00
Martin Kiewitz 0941dcdb67 SCI32: Add a bit more debug info to errors + screenitems 2016-02-21 13:59:17 +01:00
Filippos Karapetis 62546273ca SCI: Document and disable the unverified code used in GK1 2016-02-20 15:30:40 +02:00
Filippos Karapetis 988d5a2051 SCI: Add a better explanation of the visibility code used in GK1 2016-02-20 14:26:55 +02:00
Filippos Karapetis b3b6de4fd0 SCI: Handle the "visible" object selector. Fixes the inventory in GK1 2016-02-20 13:57:11 +02:00
Colin Snover 1c4778d571 SCI: Minor cleanup
1. Reorder member initialisations to match class member order
2. Use #pragma mark instead of comments for annotating sections
3. Remove useless >=0 checks on unsigned types
2016-02-18 21:11:06 -06:00
Colin Snover 03e3f2c68c SCI: Fix some rect off-by-ones 2016-02-18 13:18:03 -06:00
Colin Snover 75ccabc325 SCI: Implement accurate renderer architecture for SCI32 2016-02-18 13:18:02 -06:00