[Scummvm-cvs-logs] SF.net SVN: scummvm:[34410] scummvm/branches/branch-0-12-0/engines/gob/util .cpp

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sun Sep 7 17:22:23 CEST 2008


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

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

Modified Paths:
--------------
    scummvm/branches/branch-0-12-0/engines/gob/util.cpp

Modified: scummvm/branches/branch-0-12-0/engines/gob/util.cpp
===================================================================
--- scummvm/branches/branch-0-12-0/engines/gob/util.cpp	2008-09-07 15:21:52 UTC (rev 34409)
+++ scummvm/branches/branch-0-12-0/engines/gob/util.cpp	2008-09-07 15:22:23 UTC (rev 34410)
@@ -238,7 +238,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