From eb2b3f352ed03dc7299ff6202e68a68116476aa9 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sat, 15 May 2010 14:17:50 +0000 Subject: 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 --- engines/sci/graphics/cursor.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'engines/sci/graphics/cursor.cpp') 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; -- cgit v1.2.3