[Scummvm-cvs-logs] SF.net SVN: scummvm:[34409] scummvm/trunk/engines/gob/util.cpp

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sun Sep 7 17:21:53 CEST 2008


Revision: 34409
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34409&view=rev
Author:   drmccoy
Date:     2008-09-07 15:21:52 +0000 (Sun, 07 Sep 2008)

Log Message:
-----------
Clipping setMousePos() parameters to sane values

Modified Paths:
--------------
    scummvm/trunk/engines/gob/util.cpp

Modified: scummvm/trunk/engines/gob/util.cpp
===================================================================
--- scummvm/trunk/engines/gob/util.cpp	2008-09-07 15:16:45 UTC (rev 34408)
+++ scummvm/trunk/engines/gob/util.cpp	2008-09-07 15:21:52 UTC (rev 34409)
@@ -234,7 +234,9 @@
 }
 
 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) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list