When converting DrawList to use Common::Array in the previous commit,
I couldn't see a reason to not reuse them in frameOut() and avoid
the extra heap allocations on every frame.
When selecting a new menu while another menu open, the new menu
will be drawn before inverting the old item selection. In the
next loop iteration, when the inversion happens, it now inverts
the brand new white item.
(cherry picked from commit f7c44a452953415c3ba4dbdf96162f83efde8f51)
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: ea48986006a1d85b5302f0c3d2ac828e29a66813
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: e09010f7d8b7cc30ae3c8477d1a8b61b24d96306
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: 44b6050915ed6012f9e2e14c8ffa81d9e366529d
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:
b0b4ddcc5232485100fd42dcd14d164a8d2eaeac
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 4c369d5adfe2ddc5b9e5fd1f715b068695b0be2a
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