Commit Graph
35 Commits
Author SHA1 Message Date
Colin Snover 0f535e79f5 SCI32: Add 6-argument signature of kAddPicAt
This is used by Torin in room 50900.
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
Colin Snover 49eed5dd24 SCI32: Use extern instead of #include frameout.h for splitRects 2016-07-27 08:49:44 -05:00
Colin Snover 08821cf4e3 SCI32: Give planes a default type
With the addition of the transparent pic type code, the _type
property would be read uninitialised by setType if _pictureId was
set to kPlanePic.

CID 1357230, 1357231.
2016-07-11 10:39:50 -05:00
Colin Snover f171db965c SCI32: Guard against no split count
CID 1357229.
2016-07-11 10:39:50 -05:00
Colin Snover 4ee1901706 SCI32: Add transparent pic plane type
It is not clear if this is ever actually used by game scripts,
though.
2016-06-30 14:04:57 -05:00
Colin Snover e89bdf536d SCI32: Clean-up pass on rendering pipeline
This pass exposed two bugs, which have been fixed:

1. Checks of `_updated` and `_moved` were reversed in some areas,
   which lead to rendering bugs. In SQ6 the rendering bugs were
   subtle or non-existant, but in e.g. PQ:SWAT the Sierra logo and
   title screen animations were totally missing.

2. The renderer formerly kept reading from ScreenItemLists when
   new items were added in decrementScreenItemArrayCounts, but
   this was determined to be unnecessary.
2016-06-30 14:04:57 -05:00
Colin Snover cfda8b9ecd SCI32: Fix broken Remap implementation
Remap would crash SCI2.1early games with 19 remap slots, and
did not actually work in most cases in SCI2.1mid+ games.

The SCI16 implementation was moved to its own separate file but
was otherwise touched as little as possible, so may still have
similar problems to the SCI32 code.

1. Split SCI16 and SCI32 code into separate files
2. Use -32 prefixes for SCI32 code and no prefix for SCI16 code,
   where possible, to match other existing code
3. Avoid accidental corruption of values from the VM that may be
   valid when signed or larger than 8 bits
4. Added documentation
5. Add missing remap CelObj calls
6. Inline where possible in performance-critical code paths
7. Fix bad `matchColor` function, and move it from GfxPalette to
   GfxRemap32 since it is only used by GfxRemap32
8. Fix bad capitalisation in getCycleMap
9. Remove unnecessary initialisation of SingleRemaps
10. Update architecture to more closely mirror how SSCI worked
11. Clarify the purpose of each type of remap type (and
    associated variable names)
12. Split large `apply` function into smaller units
13. Fix buffer overrun when loading a SCI2.1early game with remap
14. Remove use of `#define` constants
15. Warn instead of crashing with an error on invalid input (to
    match SSCI more closely)
16. Change the collision avoidance mechanism between the RemapType
    enum and remap kernel functions
17. Add save/load function
2016-06-26 12:42:58 -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 741e26cfd2 SCI32: Remove unused Plane fields
These fields were written and never read in SSCI.
2016-05-26 19:06:35 -05:00
Filippos Karapetis f7ec415582 SCI32: Fix updated screen item count in remapMarkRedraw()
Thanks to snover for noticing this
2016-03-16 23:18:02 +02:00
Filippos Karapetis be58e5bc30 SCI32: More work on remapping
Still not working
2016-03-15 21:06:46 +02:00
Colin Snover 80098c8423 SCI32: Remove incorrect note about dword_C6288
Any reason why flipping this condition did anything to GK1
rendering was due to other unrelated bugs in the renderer.
2016-03-13 13:20:17 -05:00
Colin Snover 8dea740086 SCI32: Implement kMovePlaneItems 2016-03-10 18:28:53 -06:00
Colin Snover 695e5db9a7 SCI32: Remove side-effect-abusing calls to ScreenItem::getCelObj 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 4297305dd5 SCI32: Clean up renderer code a bit more 2016-03-07 16:46:25 -06:00
Willem Jan Palenstijn 8be1ff109f SCI32: Fix adding too many items to drawlist 2016-03-07 23:41:06 +01:00
Colin Snover 56806161a7 SCI32: Make PlaneList definition order match declaration order 2016-03-06 21:34:44 -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
Colin Snover 4ba7f24632 SCI32: Fix incorrect insertion of new planes 2016-03-05 23:13:38 -06:00
Colin Snover 7ee2af4198 SCI32: Fix changed screen items drawing on top of higher screen items 2016-03-02 08:59:17 -06:00
Colin Snover 2e75f4b2b8 SCI32: Add consts and remove redundant conditional
Adding consts to try to isolate rectangles that change during
draw list processing, to be investigated for incorrect mutations
causing lower screen items to be drawn over higher screen items at
their edges.
2016-03-02 00:02:25 -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
Filippos Karapetis 806fa64d74 SCI32: Add a note about the menu bars in GK1 2016-03-01 04:50:26 +02:00
Colin Snover 0abd5b5c4e SCI: Use nullptr instead of 0 for null pointer checks 2016-02-21 09:32:34 -06:00
Willem Jan Palenstijn 26a5efe6e8 SCI: Fix redrawAll updating visiblePlanes
It was comparing ScreenItem*'s directly, instead of objects.
2016-02-21 12:52:25 +01:00
Willem Jan Palenstijn 53ed7f6ac1 SCI: Rewrite Plane::mergeToRectList
The old one would continue reading from outerRect after it was deleted.
2016-02-20 12:26:54 +01: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 3e820ee9b3 SCI: Fix bad positioning of relatively positioned pic cels 2016-02-18 13:18:03 -06:00
Colin Snover 03e3f2c68c SCI: Fix some rect off-by-ones 2016-02-18 13:18:03 -06:00
Colin Snover 3c9b930506 SCI: Add comments to plane code 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