aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2008-09-07 15:21:52 +0000
committerSven Hesse2008-09-07 15:21:52 +0000
commita7d917ea43d771e62932573b8a3caefa6bd0dacc (patch)
treee44a6c529e53fd5ade0972b182e537e9d0631020 /engines/gob
parentf5462901b24f5a1191f3d68d866e4ee75a006347 (diff)
downloadscummvm-rg350-a7d917ea43d771e62932573b8a3caefa6bd0dacc.tar.gz
scummvm-rg350-a7d917ea43d771e62932573b8a3caefa6bd0dacc.tar.bz2
scummvm-rg350-a7d917ea43d771e62932573b8a3caefa6bd0dacc.zip
Clipping setMousePos() parameters to sane values
svn-id: r34409
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/util.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp
index 0a7b889031..fa1683b109 100644
--- a/engines/gob/util.cpp
+++ b/engines/gob/util.cpp
@@ -234,7 +234,9 @@ void Util::getMouseState(int16 *pX, int16 *pY, int16 *pButtons) {
}
void Util::setMousePos(int16 x, int16 y) {
- g_system->warpMouse(x + _vm->_video->_screenDeltaX, y + _vm->_video->_screenDeltaY);
+ x = CLIP<int>(x + _vm->_video->_screenDeltaX, 0, _vm->_width);
+ y = CLIP<int>(y + _vm->_video->_screenDeltaY, 0, _vm->_height);
+ g_system->warpMouse(x, y);
}
void Util::waitMouseUp(void) {