Commit Graph
144 Commits
Author SHA1 Message Date
sluicebox c346905a1a SCI: Reset palette cycling when loading games
Fixes frozen palette animation when loading from within the engine
2022-07-30 16:39:26 -04:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh 940c7bfc14 SCI: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
sluicebox a7ea64280d SCI: Handle HOYLE4 Mac palette endianness 2021-10-16 01:05:43 -05:00
sluicebox f20c9ab958 SCI: Fix pathfinding debug colors in SCI 1.1 games
The pathfinding debugging code is using Sierra's buggy 8-bit matching
algorithm to find colors for drawing obstacles and path points in most
of the SCI 1.1 games. This usually results all colors being black.
Now we select the good 16-bit algorithm for internal use.
2021-08-13 15:36:15 -05:00
sluicebox 813d5ca6c9 SCI: Improve kPaletteSetIntensity speed throttling
Detect when kPaletteSetIntensity is called from an unthrottled
script loop and only apply speed throttling in that situation.

This fixes several slow fade-in / fade-outs such as KQ6's Sierra
logo and title screen. We've been throttling kPaletteSetIntensity
on every call, even when it was being used once per game cycle
(which our kGameIsRestarting throttling already handles) or within
kWait-throttled loops. In both cases this has added delays on top
of delays and slowed things down even further.
2021-04-12 11:12:01 -07:00
sluicebox 9982c761a2 SCI: Update all old bug tracker ticket numbers 2021-02-25 01:18:52 -08:00
Willem Jan Palenstijn 0be765b288 SCI: Add support for RGB rendering 2020-10-24 02:55:01 +03:00
sluicebox 1d67ba6668 SCI: PalVary includes palette entries 0 and 255
Fixes color 0 in QFG1VGA at night. This is the menu bar background.

QFG1VGA uses a soft black (27,27,27) for color 0 during the day and
regular black (0,0,0) at night. Until recently, ScummVM didn't display
the soft black, because it didn't include color 0 when copying pic
palettes to the system palette. Now that color 0 is included, it's
exposed that PalVary has been excluding colors 0 and 255 when
calculating the new palette, preventing QFG1VGA's soft black from
transitioning to regular black at night.

SSCI includes all entries when calculating the new palette.
2020-08-18 03:07:18 -07:00
sluicebox 43ae2cc2ce SCI: Set palette entry 0 on more SCI 1.1 operations
In SCI 1.1 most palette operations copy entry 0 to the system palette,
such as when drawing a view. This continues an earlier fix which
included entry 0 when drawing a pic and exposed that this needs to
happen in other places too: 3de471de36

Fixes bug #11544 where a KQ6 RAVE resource ended up with the wrong
color in room 380. System palette entry 0 ended up as [7,7,7] when
the RAVE was drawn instead of black, the expected color, causing the
RAVE palette to merge incorrectly. [7,7,7] comes from pic 380's
palette, after which entry 0 should be set to black when drawing
view 5 and copying its palette, which is what now happens.
2020-08-11 01:39:31 -07:00
sluicebox 3de471de36 SCI: Set first palette color when drawing a 1.1 pic
When drawing a pic while pal-very isn't active, SSCI 1.1 sets the
first 255 palette colors, as opposed to skipping the first when
normally inserting a palette. Without this, a palette cycle that
includes the first color will permanently alter the system palette,
such as in Hoyle4 when winning the Klondike game with certain
table backgrounds.

Fixes bugs #11164 and #11195
2020-01-16 04:32:14 -08: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
Willem Jan Palenstijn 65861bb914 SCI: Change workaround for PalVary / Animate race condition
The new approach is to delay kAnimate briefly (with an 68ms timeout)
while there is a zero-tick PalVary running, so that it has time to
trigger.

The previous workaround would immediately process a zero-tick
PalVaryInit/PalVaryReverse. This caused problems in QfG3 (bug #10304)
where it interfered with PalVaryPause.

The previous workaround could also be modified to handle pause/resume,
but this new approach should be closer to SSCI's behaviour, which used a
timer for a zero-tick PalVary too.

This fixes bug #10304, and keeps #5298 fixed too.
2018-04-22 22:54:18 +02:00
Colin Snover a233696212 SCI: Update formatting strings to match updated Span API 2017-03-30 14:23:41 -05:00
Colin Snover 31daa956d6 SCI: Implement bounds-checked reads of game resources 2017-03-27 19:42:31 -05:00
Willem Jan Palenstijn 95ab3bece9 SCI: Add FIXME for (very unlikely) race condition in _palVarySignal 2017-01-06 19:03:50 +01:00
Colin Snover 2071196f42 SCI32: Add bitmap segment and remove GC option from hunk segment 2016-08-01 10:37:14 -05:00
Colin Snover 4a637d65c3 SCI32: Enable optional explicit memory management of hunk entries
Bitmaps in ScrollWindow and Robot code are managed by the kernel
and not by game scripts, although they must be able to be
referenced through a reg_t. To prevent incorrect GC of bitmaps
that are in use but not referenced by any game script, explicit
memory management of hunk entries can be enabled.
2016-08-01 10:37:14 -05: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
Alexandre Detiste 6c298e964f JANITORIAL: Typos detected with lintian & grep 2016-02-15 18:27:02 +01:00
Colin Snover 76bd2eeb2e SCI: Use tick-based timing more consistently
This means tick-based times are saved to save games, as in SCI32
engine, instead of seconds, which are not accurate enough. It
also means places in SCI engine that need to access game ticks
should do so through g_sci instead of g_system or g_engine.
2016-01-14 16:13:22 -06:00
Colin Snover fb891e4c08 SCI: Implement SCI32 kPalVary and kPalette setFade
This also fixes kPalCycle signatures to be more accurate.
2016-01-14 16:13:22 -06:00
Filippos Karapetis a119108835 SCI: Fix compilation 2016-01-08 11:09:29 +02: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 5c91173337 SCI: color matching bug fix 2014-10-29 00:12:12 +01:00
Martin Kiewitz bb29cdc899 SCI: color matching - remove debug code 2014-10-28 22:41:14 +01:00
Martin Kiewitz 28967b617f SCI: properly reversed color matching thanks wjp 2014-10-28 22:37:57 +01:00
Martin Kiewitz f317e8c877 SCI: implement 8-bit color matching SCI1.1 bug
effectively fixes bug #6455
thanks to wjp and [md5]
2014-10-28 01:40:40 +01:00
Willem Jan Palenstijn da9ffe9dbc SCI: Add note on SSCI 11 FindColor bug 2014-10-27 23:04:25 +01:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Filippos Karapetis 46ebf37ec9 SCI: Change wording for bug/further info references 2013-04-27 14:04:27 +03:00
Filippos Karapetis cf3890b79a SCI: Remove obsolete comment and code 2013-01-11 02:24:18 +02:00
D G Turner 77a9f01454 SCI: Amended fix for palette related compiler warnings. 2012-11-26 21:08:39 +00:00
Filippos Karapetis 9c510c1b52 SCI: Fix warnings 2012-11-26 11:27:02 +02:00
Filippos Karapetis 7d436622a8 SCI: More work on kRemapColors
This implements some more color remap-based palette effects, found in QFG4
2012-08-21 03:32:23 +03:00
Filippos Karapetis 797dbfe506 SCI: Set the RemapByPercent palette initially
This needs to be performed because the screen palette might not change
after the call. Fixes the display of the bat in the character selection
screen in the full version of QFG4
2012-07-25 01:16:13 +03:00
Filippos Karapetis 537b1969bf SCI: Rewrite the color remapping code to support simultaneous effects
Fixes the torch in the full version of QFG4
2012-07-25 00:58:16 +03:00
Filippos Karapetis 37b209dac1 SCI: Refresh remapping by percent whenever the screen palette changes 2012-07-24 22:55:34 +03: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 a643981a38 SCI: Handle resource ID -1 when setting the palVary resource
Fixes several wrong colors in SQ6
2012-06-08 11:57:43 +03:00
Filippos Karapetis ae54885379 SCI: Updated information regarding bug #3439240 2011-11-17 11:16:10 +02:00
Filippos Karapetis 5fc9831577 SCI: Fixed bug #3439240 - "QFG1VGA: Game Crashes While Sleeping at Erana's Peace" 2011-11-17 11:00:09 +02:00
Filippos Karapetis 747bc75bc7 SCI: Fixed typo in colorIsFromMacClut() 2011-11-03 22:40:28 +02:00
Filippos Karapetis 935eaa175b SCI: Move the palette merging checking code inside the GfxPalette class 2011-10-19 23:52:51 +03:00
Filippos Karapetis 722ce77675 SCI: Wrapped some very long lines 2011-10-19 20:29:01 +03:00
Filippos Karapetis 4717d11862 SCI: Added support for the halfbrite palette used in Longbow Amiga
This fixes the remaining palette problems in the game (bug #3309036)
2011-09-27 16:54:14 +03:00
Filippos Karapetis 300cec119c SCI: Bugfix for the palette of Longbow Amiga (still not right) 2011-09-25 04:10:20 +03:00
Eugene Sandulenko 78f1ea7690 OSYSTEM: extended installTimerProc() with timer ID parameter 2011-08-06 11:28:35 +01:00