Commit Graph
30 Commits
Author SHA1 Message Date
Colin Snover 2071196f42 SCI32: Add bitmap segment and remove GC option from hunk segment 2016-08-01 10:37:14 -05:00
Colin Snover 631d22c4ac SCI32: Remove dead placeholder rendering code 2016-07-27 08:50:03 -05:00
Colin Snover 4cfc387602 SCI32: Split GfxPalette and GfxPalette32 + HunkPalette 2016-07-11 10:39:50 -05: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 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
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 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 4840b889d7 SCI32: Initialise pointers in CelObj scaler
This ensures that if there is a bug in the drawing code that causes
the row to be unset, it will not result in silently reading garbage
out of random memory.

CID 1354802
2016-05-27 15:54:14 -05:00
Colin Snover 746c4e7b03 SCI32: Fix CelObj cache
The previous implementation did not work properly, assigning the
next insertion index to the oldest object instead of filling empty
cache slots on a cache miss.
2016-05-27 15:54:14 -05:00
Filippos Karapetis 5a547bd242 SCI32: Implement analyzeForRemap() 2016-03-16 01:51:09 +02:00
Filippos Karapetis 5be798c92f SCI32: Implement the remapping drawing functions 2016-03-16 01:51:09 +02:00
Filippos Karapetis 1f47766b60 SCI32: Implement analyzeUncompressedForRemap() 2016-03-16 01:51:08 +02:00
Filippos Karapetis f94ddfe5a6 SCI32: Spacing 2016-03-16 01:51:07 +02:00
Filippos Karapetis a393a1348a SCI32: Remove dead code related to priority map handling
The priority map is not used at all in SCI32 at the engine level by
design, so all the relevant code that handles picture priority is
pretty much dead
2016-03-16 01:51:07 +02:00
Filippos Karapetis be58e5bc30 SCI32: More work on remapping
Still not working
2016-03-15 21:06:46 +02:00
Colin Snover e6842022db SCI32: Fix scaler drawing pixels at the wrong positions
In order for scaling ratios to apply equally across objects that
start at different positions on the screen, the pixels that are
read from the source bitmap must all use the same pattern of
division. In other words, cels must follow the same scaling pattern
as if they were drawn starting at an even multiple of the scaling
ratio, even if they were not.
2016-03-13 22:28:39 -05:00
Colin Snover bfd7e4e784 Revert "SCI32: Fix small inaccuracy in the scaling drawing code"
This reverts commit d85eb8ded6.

This patch did not correctly fix the scaler to follow the same
rules as SSCI and only worked on the y-axis.
2016-03-13 22:28:39 -05:00
Martin Kiewitz d85eb8ded6 SCI32: Fix small inaccuracy in the scaling drawing code
Previously sourcePos was always originating from plain 0, 0
which made some pixels not always getting drawn at the right
spot when uneven scaling was used (for example 5:12).
Seems to fix gabriel knight 1 hires graphic issues
2016-03-13 13:12:36 +01:00
Johannes Schickel 7be486ae27 SCI: Slight template formatting fixes. 2016-03-08 20:15:22 +01:00
Johannes Schickel 693f8dc295 SCI: Add missing namespace comments in graphics/. 2016-03-08 20:13:05 +01:00
Colin Snover 73eea88939 SCI32: Move in-memory bitmap read/write into its own class 2016-03-07 20:51:06 -06:00
Colin Snover 36800b7017 SCI32: Fix memory leaks 2016-03-06 21:34:43 -06:00
Colin Snover 9a280d3965 SCI32: Add all kBitmap signatures
Not all SCI2.1late/SCI3 function signatures are fully known yet,
but all subops are now represented in the kernel tables.
2016-03-03 20:31:10 -06:00
Colin Snover e5b30fb9af SCI32: Fix bad reads of mirrored cels 2016-03-01 21:12:31 -06: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
Filippos Karapetis c1dacbe65d SCI: Use American English, like we do in other parts of ScummVM
This replaces "colour" to "color"
2016-02-19 02:50:16 +02:00
Colin Snover 5a1fa5efa1 SCI: When rewriting lookup tables, also actually record what scale they are for 2016-02-18 13:18:03 -06:00
Colin Snover 775c39102a SCI: Implement templated drawing subroutines 2016-02-18 13:18:02 -06:00
Colin Snover 75ccabc325 SCI: Implement accurate renderer architecture for SCI32 2016-02-18 13:18:02 -06:00