Commit Graph
22 Commits
Author SHA1 Message Date
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 8985f8f447 SCI32: Always sort kernel-generated screen items above script-generated screen items in last-ditch sort
Fixes Trac#10257. Fixes Trac#10261.
2017-10-02 21:35:21 -05:00
Colin Snover 7543bd444d SCI32: Move priority comparison of ScreenItems into its own function
Rendering bugs in ScummVM are often caused by buggy game scripts
relying on the last ditch sort, which is not the same in ScummVM
as in SSCI (since the SSCI last ditch sort relies on a different
memory architecture and is super buggy). However, these bugs do
not show up very frequently these days, so it is easy to forget
all the places that need to be checked when debugging a rendering
problem that appears to be caused by sorting failure.

This commit breaks out the last ditch comparison formerly in
Plane::calcLists to hopefully make it more visible to future
programmers.

Refs Trac#9957.
2017-07-13 21:31:07 -05: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 2a27f27bb4 SCI32: Clean up scaling flags 2016-09-29 19:39:16 -05:00
Colin Snover 0f2748b15a SCI32: Implement kRobot 2016-08-19 14:08:22 -05:00
Colin Snover b6dbc79021 SCI32: Add support for blacklined video
Ow. My eyeballs.
2016-07-10 09:36:10 -05:00
Colin Snover 4d91b458e5 SCI32: Implement kPlayVMD 2016-07-10 09:35:24 -05:00
Colin Snover 07b72c9fec SCI32: Document ScreenItem::_insetRect 2016-07-02 22:28:37 -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 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
Eugene Sandulenko 4bb793a72d SCI: Fix warning 2016-05-28 17:09:50 +02: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 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 d486921820 SCI32: Add reg_t comparisons for graphics sorting 2016-03-07 16:46:25 -06:00
Colin Snover 36800b7017 SCI32: Fix memory leaks 2016-03-06 21:34:43 -06:00
Colin Snover 3e631ca5e3 SCI32: "Improve" comparison algorithm for planes and screen items
This adds a slightly more accurate comparison algorithm that will
at least ensure that all the engine-generated planes and screen
items with matching priorities will be sorted above
script-generated planes and screen items, like in the original
engine. It still does not sort script-generated items by memory
handle order, so if that is ever a thing that actually happens,
those may still be in the wrong order.
2016-03-06 21:34:43 -06:00
Colin Snover 1337cd3dec SCI32: Implement kEditText 2016-03-06 21:34:43 -06:00
Martin Kiewitz dda637e7ac SCI32: kIsOnMe apply scaling + use mulru() thx snover 2016-02-20 16:15:01 +01:00
Colin Snover 75ccabc325 SCI: Implement accurate renderer architecture for SCI32 2016-02-18 13:18:02 -06:00