[Scummvm-git-logs] scummvm master -> 6226efcf56231b12b8069c3610785f5827dc9ad4
eriktorbjorn
noreply at scummvm.org
Mon Jun 6 10:15:40 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
6226efcf56 SCUMM: Fix mouse position after load for all rendering modes
Commit: 6226efcf56231b12b8069c3610785f5827dc9ad4
https://github.com/scummvm/scummvm/commit/6226efcf56231b12b8069c3610785f5827dc9ad4
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-06-06T12:15:36+02:00
Commit Message:
SCUMM: Fix mouse position after load for all rendering modes
Since the saved mouse position uses game coordinates, any rendering mode
that causes the graphics to be rescaled will have to convert them to
screen coordinates before warping the mouse there. (The rendering mode
scalers are separate from the backend scalers.)
Changed paths:
engines/scumm/saveload.cpp
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index c8f0f8696e3..72d2b35f43e 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1162,8 +1162,23 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
// When loading, move the mouse to the saved mouse position.
if (s.isLoading() && s.getVersion() >= VER(20)) {
+ int x = _mouse.x;
+ int y = _mouse.y;
+
+ // Convert the mouse position, which uses game coordinates, to
+ // screen coordinates for the rendering modes that need it.
+
+ if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
+ x *= 2;
+ x += (kHercWidth - _screenWidth * 2) / 2;
+ y = y * 7 / 4;
+ } else if (_macScreen || (_useCJKMode && _textSurfaceMultiplier == 2)) {
+ x *= 2;
+ y *= 2;
+ }
+
updateCursor();
- _system->warpMouse(_mouse.x, _mouse.y);
+ _system->warpMouse(x, y);
}
// Before V61, we re-used the _haveMsg flag to handle "alternative" speech
More information about the Scummvm-git-logs
mailing list