aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/cursor.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2010-05-15 14:17:50 +0000
committerMartin Kiewitz2010-05-15 14:17:50 +0000
commiteb2b3f352ed03dc7299ff6202e68a68116476aa9 (patch)
treebe15aec31d9d077ffc9760d4ee707d5e22d6503c /engines/sci/graphics/cursor.cpp
parent59a255226f95d395cb73119ae2e04a3494d404a5 (diff)
downloadscummvm-rg350-eb2b3f352ed03dc7299ff6202e68a68116476aa9.tar.gz
scummvm-rg350-eb2b3f352ed03dc7299ff6202e68a68116476aa9.tar.bz2
scummvm-rg350-eb2b3f352ed03dc7299ff6202e68a68116476aa9.zip
SCI: adding upscaled hires mode 640x480 for kq6 and gk1, fixing valgrind error in GfxPortrait class, not using priority anymore when drawing hires cels (shouldnt be needed for kq6)
svn-id: r49040
Diffstat (limited to 'engines/sci/graphics/cursor.cpp')
-rw-r--r--engines/sci/graphics/cursor.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp
index d0f8538955..5ffb233566 100644
--- a/engines/sci/graphics/cursor.cpp
+++ b/engines/sci/graphics/cursor.cpp
@@ -44,7 +44,7 @@ GfxCursor::GfxCursor(ResourceManager *resMan, GfxPalette *palette, GfxScreen *sc
_upscaledHires = _screen->getUpscaledHires();
// center mouse cursor
- setPosition(Common::Point(_screen->getDisplayWidth() / 2, _screen->getDisplayHeight() / 2));
+ setPosition(Common::Point(_screen->getWidth() / 2, _screen->getHeight() / 2));
kernelSetMoveZone(Common::Rect(0, 0, _screen->getDisplayWidth(), _screen->getDisplayHeight()));
_isVisible = true;
@@ -209,16 +209,24 @@ void GfxCursor::setPosition(Common::Point pos) {
if (!_upscaledHires) {
g_system->warpMouse(pos.x, pos.y);
} else {
- g_system->warpMouse(pos.x * 2, pos.y * 2);
+ _screen->adjustToUpscaledCoordinates(pos.y, pos.x);
+ g_system->warpMouse(pos.x, pos.y);
}
}
Common::Point GfxCursor::getPosition() {
Common::Point mousePos = g_system->getEventManager()->getMousePos();
- if (_upscaledHires) {
+ switch (_upscaledHires) {
+ case GFX_SCREEN_UPSCALED_640x400:
mousePos.x /= 2;
mousePos.y /= 2;
+ break;
+ case GFX_SCREEN_UPSCALED_640x480:
+ mousePos.x /= 2;
+ mousePos.y = (mousePos.y * 5) / 12;
+ default:
+ break;
}
return mousePos;