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.
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.
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
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.
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.
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.
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.
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.
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
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.
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)
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!
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!
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
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
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
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
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.
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.