[Scummvm-cvs-logs] SF.net SVN: scummvm:[45260] scummvm/trunk/engines/agi/graphics.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Oct 20 13:13:22 CEST 2009


Revision: 45260
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45260&view=rev
Author:   fingolfin
Date:     2009-10-20 11:13:22 +0000 (Tue, 20 Oct 2009)

Log Message:
-----------
AGI: cleanup GfxMgr::testButton

Modified Paths:
--------------
    scummvm/trunk/engines/agi/graphics.cpp

Modified: scummvm/trunk/engines/agi/graphics.cpp
===================================================================
--- scummvm/trunk/engines/agi/graphics.cpp	2009-10-20 11:13:00 UTC (rev 45259)
+++ scummvm/trunk/engines/agi/graphics.cpp	2009-10-20 11:13:22 UTC (rev 45260)
@@ -769,17 +769,8 @@
 
 int GfxMgr::testButton(int x, int y, const char *s) {
 	int len = strlen(s);
-	int x1, y1, x2, y2;
-
-	x1 = x - 3;
-	y1 = y - 3;
-	x2 = x + CHAR_COLS * len + 2;
-	y2 = y + CHAR_LINES + 2;
-
-	if ((int)_vm->_mouse.x >= x1 && (int)_vm->_mouse.y >= y1 && (int)_vm->_mouse.x < x2 && (int)_vm->_mouse.y <= y2)
-		return true;
-
-	return false;
+	Common::Rect rect(x - 3, y - 3, x + CHAR_COLS * len + 3, y + CHAR_LINES + 3);
+	return rect.contains(x, y);
 }
 
 void GfxMgr::putBlock(int x1, int y1, int x2, int y2) {


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