Commit Graph
1626 Commits
Author SHA1 Message Date
sluicebox a316bde435 SCI: Use default parameter in Path::toString() 2023-01-08 11:41:01 -08:00
sluicebox ae5db52c2e SCI: Remove speed test detector
This heuristic was originally how all SCI16 speed tests were handled.
It has been gradually replaced with script patches, until all games
were patched in: ea48986006

At the time, I left this in because it had the benefit of speeding up
the SCI11 test variants so that they didn't produce a startup delay.
Now we know that this heuristic has been identifying regular rooms as
speed tests and unthrottling them too, causing unintended effects.
Some of this behavior was masked by fast-cast throttling occurring
everywhere, until: e09010f7d8

For example, the QFG1VGA Sierra logo animation changes speed and runs
very fast as soon as the sparkle is finished. The Longbow map rooms
were also detected as speed test rooms and animated too fast. Cast-less
rooms like LB2's title screen run unthrottled and consume CPU.

There are only a few SCI11 speed test rooms, so now they're explicitly
unthrottled in kGameIsRestarting with the other throttling exceptions.
2022-12-21 12:26:51 -08:00
Vladimir Serbinenko 97bc2d843a SCI: Don't use rawString 2022-12-14 05:08:46 +01:00
sluicebox aaebd2aa85 SCI: Fix some comments 2022-11-12 19:33:37 -08:00
sluicebox daed465639 SCI: Add option for high resolution Mac fonts
This adds the existing GAMEOPTION_HIGH_RESOLUTION_GRAPHICS option to
Mac games with native fonts. Default is enabled. If disabled, then the
low resolution Mac fonts are used and the game isn't upscaled.
2022-11-06 23:05:20 -08:00
sluicebox 1efdb1cb6c SCI: Add support for Macintosh fonts
High-resolution native Macintosh fonts are now supported in the
following games when the game's executable is present:

- Castle of Dr. Brain
- Freddy Pharkas
- King's Quest 6
- Leisure Suit Larry 1
- Leisure Suit Larry 5
- Space Quest 1

And in these games when classicmacfonts.dat is present:

- Leisure Suit Larry 6 (floppy)
- Quest for Glory 1
2022-11-06 23:05:20 -08:00
sluicebox 1eeb0b1f24 SCI: Add scaling for Mac icon bar
Required for Mac fonts.

This also makes the disabled icons appear as they did in the original.
Mac SSCI would draw the disabled pattern at high resolution after
upscaling the icon image, not before.
2022-11-06 23:05:20 -08:00
sluicebox 2506f89717 SCI: Add scaling for Mac cursors (SCI16)
Required for Mac fonts
2022-11-06 23:05:20 -08:00
sluicebox f779535e3e SCI: Fix vector pattern regression
Restores correct adjustments for vector patterns that extend past the
left or top picture edges. This was accidentally altered to occur
after the port adjustment in: 44b6050915

Fixes bug #13914 where the top of PQ2 room 1 was drawn out of bounds.
2022-11-03 21:06:06 -07:00
Hubert Maier b756b36aa9 SCI: Correct spelling mistake
questionaire -> questionnaire
2022-10-27 15:57:28 +02:00
Le Philousophe 0b918a5352 SCI: Rename strcpy function to prepare for forbidden name
Even though strcpy in SegManager isn't a problem, our forbidden symbols
list being defined at preprocessor level, we won't be able to use this
name anymore.
2022-10-23 22:46:19 +02:00
Zvika Haramaty 34873d127f SCI32: Make RTL BiDi conversion direction hard coded
The default behaviour for `Common::convertBiDiString` is to use
BIDI_PAR_ON for direction, which means that it tries to guess to
paragraph language, and choose the direction according to it.

However, in SQ6 many (all?) texts begin with control characters,
which make that function to think that these are English texts,
and therefore it chooses LTR direction, and punctuations are wrongly
placed.

Since the call to the function is under `if` clause for RTL,
it's safe to hard code that direction.
2022-09-05 20:24:07 +03:00
sluicebox e09010f7d8 SCI: Restrict kGetEvent throttling to fast cast mode
In 2010 a 10 ms delay was added to every kGetEvent call to prevent
maxing out the CPU when some games display message boxes:
b0b4ddcc52

This rapid kGetEvent polling is called fast cast and it only exists in
SCI1.1 games and some SCI1 games. It occurs in an inner loop when the
fast cast global is set.

Now the workaround is only applied to fast cast games and only when the
kGetEvent polling occurs.

Removing this 10 ms delay from every SCI16 game cycle doesn't change
game speed by itself because the larger dynamic throttling in
kGameIsRestarting has been absorbing the 10 ms. But this does make the
other throttles easier to understand and work with, and solves minor
edge cases where delays from multiple kGetEvent calls add up.
2022-08-02 17:23:34 -04:00
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
sluicebox c84e747e3b SCI32: Initialize ScrollWindow line indices
ScrollWindow's constructor was missing a call to initialize
line indices. Using a scrollbar before any text had been added
accessed an uninitialized array and failed an assertion.

Fixes bug #13542 in LSL6-Hires
2022-06-06 17:30:47 -04:00
sluicebox ea48986006 SCI: Disable speed tests with script patches
Disables SCI16 speed tests with generic script patches.

- All games now pass their speed tests, and consistently.
- Handles games/versions that the benchmarking heuristic misses.
- Fixes bug #13529 (speed test overflow on fast CPUs) on all games.
- Replaces most game-specific patches.

I've left the benchmarking heuristic so that any game or version that
still needs patching will still be handled with unthrottling.
2022-06-06 17:20:58 -04:00
sluicebox fed2504257 SCI: Fix QFG1VGA PC pic window initialization
I forgot the platform test in a3c3865877

Also, a second attempt at explaining something confusing
2022-06-06 17:20:58 -04:00
sluicebox 3c3ed549f1 SCI: Disable JONES speed test
Fixes bug #13529
2022-06-03 12:00:58 -04:00
sluicebox a3c3865877 SCI: Initialize pic window correctly for QFG1VGA Mac
Fixes the opening background being drawn 10 pixels too low
2022-05-20 14:20:22 -04:00
sluicebox 34983d1017 SCI: Fix out of bounds read when measuring text
Found with valgrind. The OOB read did not affect behavior.
Introduced in 8a87d1030c
2022-05-18 14:26:06 -04:00
sluicebox 510f0e684d SCI: Fix some function declarations 2022-03-27 18:58:24 -04:00
sluicebox e23f5fe855 SCI32: Update kSetShowStyle version checks for Mac
Consolidated kSetShowStyle version/argument checks and updated them to
handle SCI2.1 Mac games and PC demos. (The demos where the wrong
arguments were being applied happened to work anyway.)

Fixes LSL7 Mac pixel dissolve at the start of the game between the
postcard and the boat (rooms 120 and 130)
2022-03-22 07:32:55 -04:00
D G Turner 78db82f6e1 SCI: Fix Undefined Macro Compiler Warnings
These warnings are emitted by GCC if -Wundef is passed.
2022-03-15 10:17:12 +00:00
sluicebox 44b6050915 SCI: Fix vector pattern clipping behavior
Vector patterns weren't drawn accurately if the pattern's box touched
the right edge of the screen. This was due to clipping behavior that
differed from the original:

- The pattern's box was re-positioned one pixel too far to the right.
- The pattern's box was clipped to the screen and then drawn.
  Patterns require evaluating all pixels (consuming pattern and texture
  data) even if a pixel has to be skipped for being out of bounds.

Fixes a subtle inaccuracy in picture 2 of SQ3.
Unrelated to 4c369d5adf

Thanks again to @eientei95 for spotting this!
2022-03-02 01:00:57 -05:00
sluicebox 4c369d5adf SCI: Fix incorrect values in vector texture table
Fixes incorrect values that trace back to SCI Decoder in 1992.

These caused subtle inaccuracies when drawing EGA vector pictures
with certain texture patterns. In SQ3 there are two of these
surrounding the escape pod in picture 2 in the first room.

Thanks to @eientei95 for spotting the picture discrepancy!
2022-03-02 00:55:51 -05:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Filippos Karapetis 8a748f7e03 SCI: Add TTS support for SCI32 floppy games (QFG4, GK1, PQ4) 2021-12-24 02:57:27 +02:00
Filippos Karapetis ee2995fe82 SCI: Don't hook up kDisplay to TTS
kDisplay is used to redraw parts of the UI, so it's not ideal to hook
TTS there, as it keeps spamming sentences that get redrawn in the UI
frequently, such as the intro text and the points in SQ5
2021-12-24 02:57:27 +02:00
Filippos Karapetis a488bb47e8 SCI: Text to Speech (TTS) functionality for SCI16 (SCI0 - SCI1.1) games
This is based on the work done for GSoC by @taylorzhancher in PR #3256

Highlights:
- TTS has been hooked globally onto places where text is shown
- TTS is currently performed for textboxes and button texts
- TTS stops when text windows are disposed (which enhances the in-game
  experience)
- No game-specific logic has been added
- This hasn't been extensively tested with all SCI16 games yet
- There will be cases that are not handled properly yet
- The TTS functions have been grouped under a SciTTS class
2021-12-24 02:57:27 +02:00
sluicebox c577976cd7 SCI: Remove FIXME from intended fall-throughs 2021-12-20 23:04:42 -05:00
sluicebox 8a87d1030c SCI: Fix newline handling in Japanese PQ2
Many PQ2 Japanese strings contain escaped newlines ("\n") which we have
not been handling. We have been handling these in getSciLanguageString()
when returning Japanese text but that's not where SSCI does this work.
PQ2's Print procedure in script 255 parses Japanese text itself and our
getSciLanguageString() is never involved.

Now Japanese newline handling is done in the core text measuring and
drawing functions, which is closer to where SSCI did it, but without the
hack of having GetLongest() patch out Japanese newlines like in SSCI.

Fixes bug #13154
2021-12-13 11:43:35 -07:00
Orgad Shaneh 940c7bfc14 SCI: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
Alexandre Detiste 6044504762 JANITORIAL: typos
some in the variable names, some in the comments;
no change for the strings that interract with original games assets
2021-10-31 20:46:31 +01:00
Filippos Karapetis b606509034 SCI32: Update comments concerning the kShowStyleNone change in Hoyle 5
Turns out that this was one of the interpreters where Sierra actually
changed the transition code for fading in/out, so don't mark it as a
hack anymore. Thanks to @sluicebox for his help on verifying this one
2021-10-17 20:28:09 +03:00
sluicebox a7ea64280d SCI: Handle HOYLE4 Mac palette endianness 2021-10-16 01:05:43 -05:00
sluicebox 0aa55ce452 SCI32: Avoid global constructors in CelObj
Fixes the last clang warning in the SCI engine
2021-08-24 18:01:42 -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
Paul Gilbert 0136043f09 COMMON: Revert Change Rect and Point to have int32 fields
This reverts commit 1c3e7fb4e9.
2021-07-06 20:35:42 -07:00
Paul Gilbert 1c3e7fb4e9 COMMON: Change Rect and Point to have int32 fields 2021-07-04 18:24:26 -07:00
Torbjörn Andersson 7746c00a64 SCI: Fix a tiny memory leak in GfxText16 2021-06-04 07:00:30 +02:00
sluicebox f7ba6bb448 SCI: Remove redundant assert 2021-05-23 16:52:43 -06:00
sluicebox 05a4e55634 SCI32: Fix color comparison typo in previous commit 2021-05-21 10:53:15 -06:00
sluicebox e09c6d13e4 SCI32: Handle kShowStyleDissolve Mac palette 2021-05-21 02:35:21 -06:00
sluicebox 5d419e320b SCI: Remove extra semicolon 2021-05-18 17:46:41 -06:00
sluicebox 05d5299c54 SCI: Remove unused 640x480 mode from SCI16 code
This is old SCI32 code that should have been removed from
GfxScreen when GfxScreen32 was created.
2021-05-14 17:37:19 -06:00
sluicebox 7957b50af1 SCI: Add option to use SQ4 CD Windows cursors 2021-05-14 17:37:18 -06:00
Orgad Shaneh a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
sluicebox a92582ef0e SCI32: Translate Mac colors when drawing CelObjColor
Fixes several kSetShowStyle transitions such as the iris effect
in LSL6 Hi-res Mac at the end of the beach scene at night (room 860)
2021-05-01 14:29:18 -07:00
Eugene Sandulenko 5e7fe2dc57 JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02: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