diff options
author | Sven Hesse | 2008-09-07 15:21:52 +0000 |
---|---|---|
committer | Sven Hesse | 2008-09-07 15:21:52 +0000 |
commit | a7d917ea43d771e62932573b8a3caefa6bd0dacc (patch) | |
tree | e44a6c529e53fd5ade0972b182e537e9d0631020 | |
parent | f5462901b24f5a1191f3d68d866e4ee75a006347 (diff) | |
download | scummvm-rg350-a7d917ea43d771e62932573b8a3caefa6bd0dacc.tar.gz scummvm-rg350-a7d917ea43d771e62932573b8a3caefa6bd0dacc.tar.bz2 scummvm-rg350-a7d917ea43d771e62932573b8a3caefa6bd0dacc.zip |
Clipping setMousePos() parameters to sane values
svn-id: r34409
-rw-r--r-- | engines/gob/util.cpp | 4 |
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) { |