diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h index 56fed3007f62..5eb3b7d7b8f4 100644 --- a/engines/tinsel/tinsel.h +++ b/engines/tinsel/tinsel.h @@ -226,7 +226,11 @@ class TinselEngine : public Engine { Graphics::Surface &screen() { return _screenSurface; } Common::Point getMousePosition() const { return _mousePos; } - void setMousePosition(const Common::Point &pt) { + void setMousePosition(Common::Point pt) { + // Clip mouse position to be within the screen coordinates + pt.x = CLIP(pt.x, 0, SCREEN_WIDTH - 1); + pt.y = CLIP(pt.y, 0, SCREEN_HEIGHT - 1); + int yOffset = TinselV2 ? (g_system->getHeight() - _screenSurface.h) / 2 : 0; g_system->warpMouse(pt.x, pt.y + yOffset); _mousePos = pt;