Commit Graph
89 Commits
Author SHA1 Message Date
Filippos Karapetis 66cbaeefe2 SCI32: Adapt the pathfinding debug code to work woth SCI32 games 2018-08-25 12:39:12 +03:00
Colin Snover 432fd522d2 ENGINES: Remove default1x scaler flag
This flag is removed for a few reasons:

* Engines universally set this flag to true for widths > 320,
  which made it redundant everywhere;
* This flag functioned primarily as a "force 1x scaler" flag,
  since its behaviour was almost completely undocumented and users
  would need to figure out that they'd need an explicit non-default
  scaler set to get a scaler to operate at widths > 320;
* (Most importantly) engines should not be in the business of
  deciding how the backend may choose to render its virtual screen.
  The choice of rendering behaviour belongs to the user, and the
  backend, in that order.

A nearby future commit restores the default1x scaler behaviour in
the SDL backend code for the moment, but in the future it is my
hope that there will be a better configuration UI to allow users
to specify how they want scaling to work for high resolutions.
2017-10-07 12:30:29 -05:00
Colin Snover c7c5f28bdb SCI32: Clean up scriptWidth/scriptHeight/screenWidth/screenHeight
This removes the unnecessary Buffer subclass and stops most places
where the output buffer was being interrogated about dimensions
instead of GfxFrameout.
2017-10-06 22:56:26 -05:00
Colin Snover f51b158f8c SCI32: Clean up GfxFrameout
* Rewrap doxygen comments to 80 columns
* Swap public/private sections so public APIs come first
* Clarify comments where easily possible
2017-10-06 22:10:51 -05:00
Colin Snover 9a8070da3c SCI: Do some clean-up of event handling system
Convert macros and vars to enums, rename keyboard events in
preparation for adding key up events, clean up unnecessary nested
conditionals, add TODOs for potential future work.
2017-09-27 20:27:33 -05:00
Colin Snover d363234129 SCI32: Fix GfxFrameout::addPlane from causing possible leaks 2017-09-19 19:54:30 -05:00
Colin Snover dabcacb0ca SCI32: Add missing method documentation 2017-07-23 10:35:13 -05:00
Colin Snover 8d32353394 SCI32: Stop throttling of kFrameOut during interactive VMD playback
Refs Trac#9974, Trac#9975.
2017-07-23 10:35:13 -05:00
Willem Jan Palenstijn 820caf370e SCI32: Fix kObjectIntersect
It was using SCI16 calls to get the NowSeenRects.

This fixes #9855.
2017-07-09 22:56:04 +02:00
Colin Snover 7057f232d7 SCI32: Improve kPlayVMD rendering
1. Added a new game option for linear interpolation when scaling
   overlay-mode video in ScummVM builds with USE_RGB_COLOR;
2. Implemented SCI2.1-variant of the VMD player renderer (fixes
   Trac#9857), which bypasses the engine's normal rendering
   pipeline;
3. Improved accuracy of the SCI3-variant of the VMD player by
   writing HunkPalettes into the VMD's CelObjMem instead of
   submitting palettes directly to GfxPalette32.
2017-07-06 19:12:38 -05:00
Colin Snover f7fcce24e1 SCI32: Remove unused method declaration 2017-07-06 19:12:37 -05:00
Colin Snover 35346bc71b SCI32: Update mouse position for rendering in all frameOuts 2017-07-06 19:12:37 -05:00
Colin Snover 9f910535c9 SCI32: Centralise OSystem screen updates 2017-07-06 19:12:35 -05:00
Colin Snover 575ed98da1 SCI32: Centralize handling of pixel format switches 2017-05-06 10:38:58 -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
Colin Snover 5dd9618842 SCI32: Remove unnecessary GfxFrameout::_frameNowVisible
This flag was used in SSCI to read from VRAM instead of from the
back buffer when a mouse interrupt was received in the middle of
a back buffer update. Since ScummVM controls when mouse events
are received via polling, it is not possible to receive a mouse
event in the middle of back buffer updates, so this code is
unnecessary for the engine to work properly.

This also fixes Valgrind warnings about use of uninitialized
memory at the start of the game, caused by not filling the cursor
memory buffers because `_frameNowVisible` was false until the first
frame was rendered.
2017-04-29 14:31:01 -05:00
Colin Snover ec12c5a342 SCI: Move ScummVM save/restore to GuestAdditions and reimplement for SCI32 2017-04-22 13:01:16 -05:00
Colin Snover 724385eb5e SCI32: Fix slow SCI2.1mid transitions
SSCI transitions code sends a large number of small show rects
to the graphics manager, one at a time, for each division of a
transition. Each time a rect is submitted, a call to showBits
is made. This design was used when transitions for SCI32 were
first implemented in ScummVM, and it worked OK because the
hardware surface was updated by EventManager::getSciEvent,
not showBits, so the large number of calls to showBits from the
transitions code did not adversely affect engine performance.

Later in SCI32 engine development, hardware surface updates
were changed to occur in showBits so that the hardware surface
would be updated at frame-out time, instead of at input-in time.
This change meant that now the large number of calls to showBits
from transitions became very expensive, and the engine would
stall constantly refreshing the entire hardware surface.

To fix this problem, the transitions code now (1) maximises the
size of rects coming from transitions, when possible, and (2) only
calls showBits when all the rects from one frame of a transition
have been calculated and added to the show rects list.

Additionally, there were some arithmetic errors in the
implementation of pixel dissolve that have been corrected in this
changeset.

Fixes Trac#9614.
2016-10-22 13:18:38 -05:00
Colin Snover 658fb7f8e4 SCI32: Improved game resolution detection 2016-09-29 19:39:16 -05:00
Colin Snover da62a99a00 SCI32: Remove unused ResourceManager from GfxFrameout 2016-08-19 15:23:10 -05:00
Colin Snover 4e1a9be816 SCI32: Remove CoordAdjuster32, at least for the moment
This may come back in the future to deduplicate some gfx code,
but SCI32 had two different inlined ways of doing coordinate
conversions with different rounding methods, so CoordAdjuster32
didn't get used when the graphics system was rewritten.

At the moment, SCI32 code uses the mulru/mulinc methods from
helper.h for scaling up/down coordinates.
2016-08-19 15:23:10 -05:00
Colin Snover 6e2e862d8e SCI32: Implement kShakeScreen for SCI32 2016-08-19 13:57:40 -05:00
Colin Snover 89a82f5b55 SCI32: Fix signature of kSetNowSeen 2016-08-19 13:57:40 -05:00
Colin Snover 80d9182554 SCI32: Implement SCI32 cursor support 2016-08-19 13:57:40 -05:00
Colin Snover 9bfeb3c297 SCI32: Remove GfxScreen from GfxFrameout
Only cursor remains to be updated to go through GfxFrameout, and
then we can let GfxScreen go back to being SCI16-only.
2016-08-19 13:57:40 -05:00
Colin Snover c28a5733e0 SCI32: Fix GfxFrameout::_isHiRes flag to be accurate for all games 2016-08-11 20:50:33 -05:00
Eugene Sandulenko 6f87a2b2e8 SCI: Fix warnings 2016-08-01 23:56:32 +03:00
Colin Snover 0f535e79f5 SCI32: Add 6-argument signature of kAddPicAt
This is used by Torin in room 50900.
2016-08-01 10:37:14 -05:00
Colin Snover 156c68fe58 SCI32: Implement plane transitions (kSetShowStyle and kSetScroll)
This commit implements all of the known plane transitions from
SCI2 through SCI2.1mid games. Because kSetShowStyle is always
called indirectly via the Styler game script, it is difficult to
find all the places where transitions are used. As such,
transitions that appeared to never be used have been added as
stubs which will trigger a game crash with a message to report
what was being done, so any missed transition types can be
identified quickly and then implemented.
2016-08-01 10:37:14 -05:00
Colin Snover 4d91b458e5 SCI32: Implement kPlayVMD 2016-07-10 09:35:24 -05:00
Colin Snover 57a53420c3 SCI32: Expose graphics throttling code
Controls that manage their own event loops and call frameOut
directly generally need to sleep in order to avoid 100% CPU,
just like the main VM event loop.
2016-07-02 22:29:28 -05:00
Colin Snover da48b1bbea SCI32: Document _remapOccurred flag 2016-07-02 22:28:53 -05:00
Colin Snover a4c059b864 SCI32: Improve accuracy of frameout throttler 2016-07-02 22:28:47 -05:00
Colin Snover 77991b7eac SCI32: Add const to getCurrentBuffer 2016-07-02 22:28:41 -05:00
Colin Snover a785147d6c SCI32: Document & clean up extra rect argument for frameOut
This extra rect seems to probably only ever be used by VMD
playback in some SCI2.1 games.
2016-06-30 14:04:57 -05:00
Colin Snover 1632bd50c8 SCI32: Fix benchmarking for QFG4 2016-06-26 12:44:36 -05:00
Colin Snover 4495ae3de0 SCI32: Remove unused dependencies from GfxFrameout 2016-06-21 08:17:28 -05:00
Colin Snover a613a27b44 SCI32: Implement line drawing (kAddLine/kUpdateLine/kRemoveLine)
This line drawing code lives in a remodelled GfxPaint32 class
that is totally separate from GfxPaint16.
2016-06-21 08:14:12 -05:00
Colin Snover b56266d28d SCI32: Fix video performance benchmarking in most SCI32 games
Most SCI32 games draw a "fred" object to the screen when the game
first starts to benchmark video performance. When framerate
throttling is enabled (which fixes many/most timing-related bugs
and reduces system load caused by unnecessary graphics updates),
the game's performance check will think that video card is slow,
causing some "high-performance" game features to be disabled.

To avoid this, we simply disable throttling during benchmarking by
detecting the "fred" object.
2016-06-14 20:58:53 -05:00
Colin Snover 17ec528c9a SCI32: Temporarily remove dead SCI2.1early transitions code
This code sneaked in with the graphics engine rewrite, but is not
ready yet to be used. It will return shortly, once it is enabled
and working.
2016-03-17 10:43:07 -05:00
Colin Snover 33cac79373 SCI32: Work around bad Styler script in KQ7 2.0b
The SCI2.1mid version of the game includes scripts designed for
SCI2.1early which means wrong parameters are sent to the kernel.
2016-03-16 22:00:38 -05:00
Filippos Karapetis a393a1348a SCI32: Remove dead code related to priority map handling
The priority map is not used at all in SCI32 at the engine level by
design, so all the relevant code that handles picture priority is
pretty much dead
2016-03-16 01:51:07 +02:00
Filippos Karapetis be58e5bc30 SCI32: More work on remapping
Still not working
2016-03-15 21:06:46 +02:00
Colin Snover 8dea740086 SCI32: Implement kMovePlaneItems 2016-03-10 18:28:53 -06:00
Colin Snover 4a16ebc970 SCI32: Implement kSetNowSeen 2016-03-10 14:16:56 -06:00
Colin Snover a2e9cc4965 SCI32: Clean up kIsOnMe and fix rounding bug
The implementation was not correctly rounding the scaled position
with mulru, leading to occasionally incorrect hit detection at
the boundaries of boxes.
2016-03-08 10:29:05 -06:00
Colin Snover 13f2a2c3bd SCI32: Add debugger command to view screen items in the visible plane list 2016-03-07 16:46:25 -06:00
Colin Snover 1337cd3dec SCI32: Implement kEditText 2016-03-06 21:34:43 -06:00
Colin Snover b6a7d8c6a5 SCI32: Minor consistency improvement to FrameOut 2016-03-02 14:02:49 -06:00
Martin Kiewitz 3e4efdbd27 SCI32: Implement syncing planes+screen items from VM for restore
Fixes restoring saved games, when ScummVM dialogs are patched in
Removing clearing planes+screen items as well, because the scripts
actually did that, but did not clear everything.
Fixes "Invalid screen item" message when entering options menu,
after restoring in SQ6.
2016-02-21 17:21:48 +01:00