Commit Graph
602 Commits
Author SHA1 Message Date
Colin Snover ff00e93c67 SCI32: Remove GfxScreen from SCI32 2016-08-19 13:57:40 -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
Filippos Karapetis 3a770fa0d8 SCI32: Initial implementation of kRemapColors
applyRemap() is still not finished, so nothing is actually visible yet
2016-03-11 05:10:32 +02:00
Colin Snover 7105fb23a8 SCI32: Use correct name of kCantBeHere kernel function
Only updating SCI32 names here due to not knowing about the
correctness of the SCI16 code.
2016-03-10 18:31:10 -06:00
Colin Snover 41b3d9ff46 SCI32: Use separate function for SCI32 version of kCantBeHere
Requested by @m-kiewitz.
2016-03-10 18:28:53 -06:00
Colin Snover 4a16ebc970 SCI32: Implement kSetNowSeen 2016-03-10 14:16:56 -06:00
Filippos Karapetis f450ca0ebf SCI: Split color remapping functionality into a separate class
Currently, only the SCI16 remapping functionality is implemented
(used in the QFG4 demo)
2016-03-08 20:36:03 +02:00
Colin Snover 3e5adc33a8 SCI32: Non-titled text bitmap implementation
This implementation is not 100% engine accurate, but it is
more accurate than what was there, and hopefully the differences
between this and the engine code are merely cosmetic.

The known (intentional) differences are:

1. Uses ScummVM rects inside the engine code, converting to/from
   SCI rects on the kernel edges and when scaling
2. Fewer side effects when performing operations that *should*
   have been pure from the start (like text dimension calculation).
   Still not side-effect-free, but at least things like colours
   and alignment do not need to be reset every time a measurement
   is taken, unlike in the actual engine.

Editor controls and some other kBitmap code are temporarily
disabled as a result of changes to GfxText32 until they can be
updated to be engine-accurate.
2016-02-28 21:48:56 -06:00
Martin Kiewitz 1ac8533b1f SCI32: Fix save patching for ScummVM dialog
- Patch game super object for saving instead of game object
- Remove re-adding planes+screen items, game::replay does that
We would only have to do that for soft-failing on restore
- Change debug levels of kNumLoops/kNumCels to 9
- Add special comment about -info- selector in syncWithScripts()

This should now make ScummVM menu saving work properly at
least in SQ6.
2016-02-21 20:33:17 +01:00
Colin Snover aeee621e44 SCI32: Add initial support for palette cycling (kPalCycle) and fading (kPalFade)
Graphics palette code was rewritten between SCI1 and SCI2, so
SCI32 palette engine code has been moved to a separate GfxPalette32
class.
2016-01-07 16:35:09 -06:00
Martin Kiewitz bfba28c335 SCI: implement delayed restore via ScummVM menu
will delay restoring a saved game until the next
 kGetEvent or kWait
also implement aborting playback for kPortrait
 and kShowMovie
2015-04-26 09:08:46 +02:00
Martin Kiewitz 3483799959 SCI: add french qfg3 export filename for fix
Sierra translator translated the filename
2015-04-13 18:26:12 +02:00
Martin Kiewitz eff78c4424 SCI: fix Japanese Space Quest 4 (intro + buttons)
At least SQ4 uses #j text prefix as signal for the
interpreter to not use the PC9801 hires font, but
to use the internal low res font instead
2014-11-04 22:01:21 +01:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Matthew Hoops 70d3610f30 SCI: Add detection for Torin Mac 2013-12-11 20:28:50 -05:00
Matthew Hoops 8a50d87445 SCI: Fix potential memory leak with Mac cursor's hotspot 2013-04-16 11:14:04 -04:00
Filippos Karapetis f2464dc474 SCI: Add subop 9 of kPalVary (used in SCI32, e.g. QFG4 when exiting the caves) 2013-01-11 02:24:17 +02:00
Filippos Karapetis fe3fb1873c SCI: Cleanup of the palette remapping code 2012-07-24 22:54:37 +03:00
Filippos Karapetis 6f35130204 SCI: More work on color remapping
More transparency/color mapping effects are now working (e.g. the
flashlight at the Gedde tomb in GK1, the rays of light at Schloss Ritter
in GK1, the torch in the QFG4 demo and the shadows in QFG4, PQ4 and KQ7)
2012-07-24 22:34:46 +03:00
Filippos Karapetis bd281928cb SCI: Initial implementation of kRemapColors(kRemapByPercent)
Fixes some graphics glitches in the QFG4 demo and the menus of QFG4, by
implementing one of the transparency effects used mainly in SCI32.
Many thanks to fuzzie for her debugging info on QFG4 demo and to wjp for
his great help on the dissassembly
2012-07-24 03:53:44 +03:00
Filippos Karapetis 61e8fdbf1d SCI: Separate the early SCI11 version of kRemapColors from the SCI32 one 2012-07-24 00:18:31 +03:00
Filippos Karapetis 10b3fdf247 SCI: Show information for correct file naming in the QFG4 import room
This information is shown in previous QFG versions, but it had to be
placed in a SCI32 graphics function in order to be shown in QFG4 too
2012-07-08 16:15:47 +03:00
Filippos Karapetis 2ef3f5e695 SCI: Update the virtual file selected in the QFG4 character import screen
This makes the character import screen in QFG4 functional, as the virtual
file index was never updated
2012-07-08 16:15:45 +03:00
Filippos Karapetis 99de89c974 SCI: Add a workaround for script bug #3537232
The bug in question is "SCI: SQ4 Floppy DOS title screen skipping too
quickly", and is caused by game scripts not waiting between palette calls
2012-06-24 19:55:28 +03:00
Filippos Karapetis 5a2e65469f SCI: Change kRemapColors(5) again. Fixes the colors in QFG4 2012-06-20 13:36:29 +03:00
Filippos Karapetis bd3366c208 SCI: Add a warning for kRemapColors(RemapByPercent) 2012-06-20 12:35:59 +03:00
Filippos Karapetis c27741ac3b SCI: Implement kRemapColors(5 - set color intensity)
It's finally nighttime in the first murder scene in PQ4
2012-06-20 12:31:51 +03:00
Filippos Karapetis 2b50824133 SCI: Add setter/getter methods to reg_t's
No functionality change has been made with this commit. This avoids
setting and getting the reg_t members directly, and is the basis of any
future work on large SCI3 scripts (larger than 64KB)
2012-06-18 05:24:06 +03:00
Filippos Karapetis f8c24b5d88 SCI: Split the SCI32 graphics kernel functions in a separate file 2012-05-20 20:16:15 +03:00
Willem Jan Palenstijn 15bbe3bff1 SCI: Expand adjustGraphColor to work for older EGA games too
See bug #3486899.
2012-02-12 13:32:22 +01:00
Filippos Karapetis 4594982ce3 SCI: Fix bug in fadeIn()/fadeOut()
This wasn't added in 4742b4d728)
2012-01-14 00:21:55 +02:00
Filippos Karapetis 29d129747d SCI: Some more work on kSetShowStyle. Silenced some chatty warnings in GK1 2012-01-13 22:55:10 +02:00
Filippos Karapetis 1cc30572e6 SCI: Remove unneeded casts (thanks to wjp for pointing that out) 2011-10-28 22:54:02 +03:00
Filippos Karapetis 4ac2940bc5 SCI: Added skeleton code for kEditText (still not working) 2011-10-28 22:20:33 +03:00
Filippos Karapetis ac559b0212 SCI: Renamed GfxControls to GfxControls16 2011-10-26 01:54:27 +03:00
Filippos Karapetis 84a185ede2 SCI: Added a detection for the second kSetShowStyle variant 2011-10-19 23:52:53 +03:00
Filippos Karapetis 513d0be106 SCI: Merged all the code to get/set the NS rect 2011-10-19 20:29:05 +03:00
Filippos Karapetis 2b9dc69ac0 SCI: Updated comments in kShowStyle() and kCelInfo() 2011-10-19 20:29:03 +03:00
Filippos Karapetis 85af217a5b SCI: Implemented kObjectIntersect() 2011-10-19 20:29:02 +03:00
Filippos Karapetis 8609e22e40 SCI: Silenced warnings 2011-10-14 20:30:22 +03:00
Filippos Karapetis b04a069782 SCI: More work on kBitmap (still WIP) 2011-10-14 14:07:01 +03:00
Filippos Karapetis 8d4e562555 SCI: Implemented kBitmap(3) and kBitmap(5). Some cleanup 2011-10-13 14:03:57 +03:00
Heather DouglassandFilippos Karapetis 084b2deccc SCI: Implementation of kCelInfo subop 4
kCelInfo subop 4 returns the pixel color at the
passed in x,y coordinates for the passed in view,
loop, cel.  Shivers uses this function for the
red door puzzle, room 23601 to determine what
blocks on the puzzle board are already occupied
by pieces.
2011-10-12 02:50:28 +03:00
Filippos Karapetis 4af034a7a9 SCI: Added proper handling of duplicate items in kAddScreenItem
- Items that are being readded to the scene should be updated instead
- Added a findScreenItem() call to simplify the code slightly
2011-10-12 02:44:16 +03:00
Filippos Karapetis a9c6d2a4c4 SCI: Some work on the SCI32 bitmap / font code
- Initial implementation of kBitmap(0)
- Bugfixes for fonts in upscaled games
2011-10-11 02:33:45 +03:00
Filippos Karapetis 4cb9a2c809 SCI: kBitmap(1) is kDisposeTextBitmap 2011-10-11 02:03:40 +03:00
Filippos Karapetis 96ce226967 SCI: Proper implementation of text drawing for SCI2+ 2011-10-11 01:25:08 +03:00
Filippos Karapetis 32b4ef8199 SCI: SCI32 kernel functions kRepaintPlane and kInputText are unused 2011-10-10 12:18:12 +03:00
Filippos Karapetis 90a11586e2 SCI: CreateTextBitmap should return a pointer. Also, silenced a warning 2011-10-09 19:56:51 +03:00
Filippos Karapetis 1dcad17988 SCI32: Documented the extra 2 params in kCreateTextBitmap(0) 2011-10-09 19:16:05 +03:00