Commit Graph
137148 Commits
Author SHA1 Message Date
Bastien Bouclet 23abcffbc5 OPENGL: Don't update the cursor's texture when the cursor is invisible
Updating the cursor's texture is not necessary if it is not going to be drawn.

Fixes glDrawArrays sometimes failing due to using a framebuffer with an
incomplete color attachment. In SCI32 games, the framebuffer is incomplete
because the engine does not define pixel data for the cursor.
2017-05-08 06:50:30 +02:00
Paul Gilbert a795c450bb SHERLOCK: Add detection entry for Italian fan translation 2017-05-07 22:51:05 -04:00
Colin Snover a403523faf SCI32: Add workaround for KQ7
Fixes Trac#9759.
2017-05-06 21:45:41 -05:00
Colin Snover c9f22eb1aa SCI32: Add missing ifdef for EngineState::_eventCounter 2017-05-06 21:23:23 -05:00
Colin Snover 8e933b79ec SCI32: Add Spanish Windows KQ7 to detection table
(The DOS version was already listed.)
2017-05-06 20:58:06 -05:00
Colin Snover 57dd79d4dc SCI32: Detect and handle tight loops around kGetEvent
In SSCI, mouse events are received through a hardware interrupt
and the cursor is drawn directly to the graphics card by the
interrupt handler. This allows game scripts to omit calls to
kFrameOut without stopping the mouse cursor from being redrawn
in response to mouse movement.

ScummVM, in contrast, needs to poll for events and submit screen
updates explicitly from the main thread. Submitting screen updates
may block on vsync, which means that this call should really only
be made once per frame, just after the game has finished updating
its back buffer. The closest signal in SCI32 for having completed
drawing a frame is the kFrameOut call, so this is where the
update is submitted (by calling OSystem::updateScreen).

The problem with the approach in ScummVM is that, even though the
mouse position is being updated (by calls to kGetEvent) and drawn
to the backend's back buffer (by GfxCursor32::drawToHardware),
OSystem::updateScreen is never called during game loops that omit
calls to kFrameOut.

This commit introduces a workaround that looks at the number of
times kGetEvent is called between calls to kFrameOut. If the
number of kGetEvent calls is higher than usual (where "usual"
seems to be 0 or 1), we assume that the game is running one of
these tight event loops, and kGetEvent starts calling
OSystem::updateScreen until the next kFrameOut call. We also
then start throttling the calls to kGetEvent to keep CPU usage
down. This fixes at least two such known loops:

1. When interacting with the menu bar at the top of the screen
   in LSL6hires;
2. When restoring a game in Phant2 and sitting on the "click mouse"
   screen.

A similar workaround may also be needed for kGetTime, though loops
around kGetTime should preferably be replaced using a script patch
to call kWait instead.
2017-05-06 19:03:54 -05:00
Colin Snover 604ac1a375 SCI32: Update cursor even when position appears unchanged
This may be masking another bug, but at least what happens in
Phant1 is that the mouse does not get redrawn after being moved
programmatically to the fast-forward button when deviceMoved
returns early.
2017-05-06 19:00:04 -05:00
Colin Snover 85105294f2 SCI32: Add some missing onFrame hooks for the debugger 2017-05-06 10:38:59 -05:00
Colin Snover 8a590e600f SCI32: Disable VMD kPlayFlagBlackPalette flag
Videos in GK2 use this flag (e.g. the chapter 6 intro).

Now that GfxPalette32::updateHardware no longer calls
OSystem::updateScreen (only GfxFrameout::frameOut does this now),
every time a palette swap occurs during playback, there is a frame
of blackness that should not exist. This is because the order of
operation is:

1. Send black palette
2. Call frameOut (which updates the screen)
3. Send new, correct palette
4. No frameOut (so the screen is not updated with the correct
   palette)

OSystem::updateScreen cannot be called multiple times for the same
frame due to vsync, but also, there does not appear to be any
reason to send a black palette, since it seems to be intended to
avoid temporarily rendering video frames with the wrong palette on
a hardware device that cannot guarantee simultaneous application
of a new palette and new pixel data. ScummVM does not have such
a problem, so this feature appears to be unnecessary for us.

For the moment, this 'feature' remains hidden behind an ifdef,
instead of being removed entirely, to avoid potential confusion
when comparing VMD code from SSCI.
2017-05-06 10:38:58 -05:00
Colin Snover 8b49313af3 SCI32: Fix terrible rendering performance when vsync is enabled
More than one call to OSystem::updateScreen per frame on systems
with vsync ruins performance because the call is blocked until
the next vsync interval.

This also fixes bad rendering performance with the OpenGL backend.
2017-05-06 10:38:58 -05:00
Colin Snover 91df45c6c5 SCI32: Fix missing/incorrect game features detection 2017-05-06 10:38:58 -05:00
Colin Snover 575ed98da1 SCI32: Centralize handling of pixel format switches 2017-05-06 10:38:58 -05:00
Colin Snover b73e275b42 SCI32: Micro-optimize speedRoom comparison 2017-05-06 10:38:58 -05:00
Tarek Soliman f30f34cbde SCI32: Set a savegame description if none was entered
This fixes the the SCI32 incarnation of Trac#5343
(defect#3061964): Savegames with no name can't be restored
2017-05-05 12:38:04 -05:00
Colin Snover 8d94a04605 SCI32: Disable game script video benchmarking
The approach to video benchmarking used by SCI engine does not
translate very well to modern video devices -- it will either be
so slow that the games think the system is not capable of showing
normal visual effects, or so fast that the benchmarks overflow
their counters. So, game scripts that perform video benchmarking
are now patched to unconditionally return the highest speed value.

A pleasant but subtle side-effect of this change is that the extra
time sitting at a blank screen before the start of a game (while
benchmarks ran) is now gone.

Fixes Trac#9741.
2017-05-04 23:00:53 -05:00
Martin Kiewitz c057f00eab SCI32: Fix comment about Phantasmagoria 2 changes between EN+DE/FR 2017-05-04 22:17:03 +02:00
Vincent Pelletier 671cca5e1a Revert "COMMON: Fix gcc warnings in get_float on big-endian"
This reverts commit 3313916a21.
While this change happens somehow to work on big-endian without
any warning, it also totally breaks little-endian... without any
warning either. I'll go RTFM C++.
2017-05-04 12:03:28 +00:00
Vincent Pelletier 3313916a21 COMMON: Fix gcc warnings in get_float on big-endian
As of gcc-6.3.0:
../common/endian.h: In function `float get_float(const char*)':
../common/endian.h:621:49: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
2017-05-04 08:01:18 +00:00
Colin Snover db17478d1a SCI32: Add Italian KQ7 detection entry
Fixes Trac#9739.
2017-05-03 16:05:50 -05:00
Martin Kiewitz 73b6f4dc40 SCI32: Fix Japanese Phantasmagoria 2 detection entry 2017-05-03 22:40:15 +02:00
Martin Kiewitz afa2c7bd2b SCI32: Add Japanese Phantasmagoria 2 detection data
Also add a bit of info to the German detection entry of
Phantasmagoria 2. Also add URL to censorship information on our wiki.
2017-05-03 21:45:04 +02:00
Bastien Bouclet e25d472aa9 SCI32: Add detecton for KQ7 1.65c French 2017-05-03 18:53:55 +02:00
Vincent Pelletier e7073dc037 ALL: Add an option to control dirty rectangless TinyGL optimisation
Exposed to command line via --[no-]dirtyrects.
As dirty rectangles make the workload vary a lot between frames, it makes
performance regressions harder to spot. Disabling it produces lower, but
much more regular FPS counts.
2017-05-03 16:52:36 +00:00
Vincent Pelletier 707a48c8c5 GRIM: Remove redundant ConfMan.registerDefault calls
These are already declared in base/commandLine.cpp .
2017-05-03 16:52:36 +00:00
Vincent Pelletier eb192cda0d ALL: Document GRIM's engine-speed command line argument
Also, move it in the ENABLE_GRIM section.
2017-05-03 16:52:36 +00:00
Vincent Pelletier 7e73c9b963 SDL: Add a --bpp command line argument
32, 16 and 0 (default) are supported, 0 currently falling back to
32 as it was the previous default (should auto-detect eventually).
Only supported by software renderer for now.
2017-05-03 16:52:36 +00:00
Colin Snover ffdfa317f1 SCI32: Add detection entry for French Shivers
Fixes Trac#9742.
2017-05-02 20:35:07 -05:00
Retro-Junk e4ab357d14 PLUMBERS: Add engine for Plumbers Don't Wear Ties 2017-05-03 00:42:13 +01:00
Thierry Crozat ee0ac26621 BASE: Fix auto-detect command to detect and start game
There were several issues.

The first one was introduced recently and caused the preferred target
to be used as a game ID, which resulted in an error when this is not
a valid game ID. Thus this fixes bug #9754.

The other issues were here since the auto-detect command was added and
caused other command line options, suh as the path, to be lost. This
usually resulted in a failure to start the game as the data files could
not be found (unless the ID happened to be the same name as a target
previously added). This also caused a reappearance of the old bug
2017-05-03 00:17:16 +01:00
Eugene Sandulenko bfd2b487eb DIRECTOR: Fix code formatting 2017-05-02 22:06:59 +02:00
Eugene Sandulenko 98f0006ad9 DIRECTOR: Reduce header dependency 2017-05-02 22:06:39 +02:00
Eugene Sandulenko c750d17b0c DIRECTOR: Fix #include paths 2017-05-02 22:04:21 +02:00
Tobia Tesan ca89722d57 DIRECTOR: Use CachedMacText for rendering 2017-05-02 21:01:23 +01:00
Tobia Tesan bd7ded3f56 DIRECTOR: Add CachedMacText to TextCast 2017-05-02 21:01:23 +01:00
Tobia Tesan 415d9d660e DIRECTOR: Add CachedMacText 2017-05-02 21:01:23 +01:00
Tobia Tesan d6f651064b DIRECTOR: Add TextCast::importStxt 2017-05-02 21:01:23 +01:00
Tobia Tesan 8b9e029c1e DIRECTOR: Remove now-useless textId parameter from renderButton 2017-05-02 21:01:23 +01:00
Tobia Tesan 61cd407405 DIRECTOR: Use text from textCasts 2017-05-02 21:01:23 +01:00
Tobia Tesan 84a65f9df0 DIRECTOR: Init textCasts with Stxts in Score 2017-05-02 21:01:23 +01:00
Tobia Tesan bad6cc32ef DIRECTOR: Equip textCast with _ftext 2017-05-02 21:01:23 +01:00
Tobia Tesan 6a741a88c9 GRAPHICS: Pass interlinear as constructor argument to MacText 2017-05-02 21:01:23 +01:00
Tobia Tesan 4ae5453af8 DIRECTOR: Add stxt.cpp 2017-05-02 21:01:23 +01:00
Tobia Tesan fca74091c3 DIRECTOR: Delete Stxts in ~Score 2017-05-02 21:01:23 +01:00
Tobia Tesan e69855acef DIRECTOR: Use preloaded Stxt for rendering 2017-05-02 21:01:23 +01:00
Tobia Tesan 2bb427d6e1 DIRECTOR: Preload Stxts in Score 2017-05-02 21:01:23 +01:00
Tobia Tesan 61e4181f5f DIRECTOR: Add _loadedStxts member to Score 2017-05-02 21:01:23 +01:00
Tobia Tesan 1de51c10dd DIRECTOR: Add Stxt.h 2017-05-02 21:01:23 +01:00
Bastien Bouclet d629dad4e1 DOCS: Fix readme headings rendering
GitHub recently changed their MarkDown implementation.
2017-05-02 21:31:21 +02:00
Colin Snover 68218d15f2 SCI32: Fix incorrect arguments to readPixel in kCelInfo
Fixes Trac#9750.
2017-05-02 11:00:45 -05:00
Vincent Pelletier 1ca4e22223 GRIM: Use drawBitmap in GfxTinyGL::copyStoredToDisplay
Removes image down-sampling to texture resolution - much nicer !
2017-05-02 12:49:04 +00:00