[Scummvm-cvs-logs] SF.net SVN: scummvm: [29753] scummvm/trunk/backends/platform/iphone

vinterstum at users.sourceforge.net vinterstum at users.sourceforge.net
Sat Dec 8 00:49:27 CET 2007


Revision: 29753
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29753&view=rev
Author:   vinterstum
Date:     2007-12-07 15:49:27 -0800 (Fri, 07 Dec 2007)

Log Message:
-----------
Enabled click-and-drag mouse mode for the right mouse button as well as the left button, and fixed a the mouse cursor being able to go 1 pixel off screen on one side

Modified Paths:
--------------
    scummvm/trunk/backends/platform/iphone/iphone_video.m
    scummvm/trunk/backends/platform/iphone/osys_iphone.cpp

Modified: scummvm/trunk/backends/platform/iphone/iphone_video.m
===================================================================
--- scummvm/trunk/backends/platform/iphone/iphone_video.m	2007-12-07 23:39:19 UTC (rev 29752)
+++ scummvm/trunk/backends/platform/iphone/iphone_video.m	2007-12-07 23:49:27 UTC (rev 29753)
@@ -93,8 +93,8 @@
 }
 
 bool getLocalMouseCoords(CGPoint *point) {
-	if (point->x < _screenRect.origin.x || point->x > _screenRect.origin.x + _screenRect.size.width ||
-		point->y < _screenRect.origin.y || point->y > _screenRect.origin.y + _screenRect.size.height) {
+	if (point->x < _screenRect.origin.x || point->x >= _screenRect.origin.x + _screenRect.size.width ||
+		point->y < _screenRect.origin.y || point->y >= _screenRect.origin.y + _screenRect.size.height) {
 			return false;
 	}
 	
@@ -208,7 +208,7 @@
 		_screenRect = CGRectMake(0, 0, _fullWidth, _fullWidth * ratio);
 		[screenLayer setFrame: _screenRect];
 
-		CGRect keyFrame = CGRectMake(0.0f, _screenRect.size.height, _fullWidth, _fullHeight);
+		CGRect keyFrame = CGRectMake(0.0f, _screenRect.size.height, _fullWidth, _fullHeight - _screenRect.size.height);
 		if (_keyboardView == nil) {
 			_keyboardView = [[SoftKeyboard alloc] initWithFrame:keyFrame];
 			[_keyboardView setInputDelegate:self];			

Modified: scummvm/trunk/backends/platform/iphone/osys_iphone.cpp
===================================================================
--- scummvm/trunk/backends/platform/iphone/osys_iphone.cpp	2007-12-07 23:39:19 UTC (rev 29752)
+++ scummvm/trunk/backends/platform/iphone/osys_iphone.cpp	2007-12-07 23:49:27 UTC (rev 29753)
@@ -712,29 +712,45 @@
 					_lastSecondaryDown = curTime;
 					_gestureStartX = x;
 					_gestureStartY = y;
-					return false;
-				} else if (curTime - _lastSecondaryDown < 250 ) {
-					if (curTime - _lastSecondaryTap < 250 && !_overlayVisible) {
-						event.type = Common::EVENT_KEYDOWN;
-						_queuedInputEvent.type = Common::EVENT_KEYUP;
-
-						event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
-						event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_ESCAPE;
-						event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_ESCAPE;	
-						_needEventRestPeriod = true;	
-						_lastSecondaryTap = 0;
-					} else {
-						event.type = Common::EVENT_RBUTTONDOWN;
+					if (_mouseClickAndDragEnabled) {
+						event.type = Common::EVENT_LBUTTONUP;
 						event.mouse.x = _mouseX;
 						event.mouse.y = _mouseY;
-						_queuedInputEvent.type = Common::EVENT_RBUTTONUP;
+						
+						_queuedInputEvent.type = Common::EVENT_RBUTTONDOWN;
 						_queuedInputEvent.mouse.x = _mouseX;
 						_queuedInputEvent.mouse.y = _mouseY;
-						_lastSecondaryTap = curTime;
-						_needEventRestPeriod = true;
-					}		
-				} else
-					return false;
+					}
+					else
+						return false;
+				} else {
+					if (curTime - _lastSecondaryDown < 250 ) {
+						if (curTime - _lastSecondaryTap < 250 && !_overlayVisible) {
+							event.type = Common::EVENT_KEYDOWN;
+							_queuedInputEvent.type = Common::EVENT_KEYUP;
+					
+							event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
+							event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_ESCAPE;
+							event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_ESCAPE;	
+							_needEventRestPeriod = true;	
+							_lastSecondaryTap = 0;
+						} else if (!_mouseClickAndDragEnabled) {
+							event.type = Common::EVENT_RBUTTONDOWN;
+							event.mouse.x = _mouseX;
+							event.mouse.y = _mouseY;
+							_queuedInputEvent.type = Common::EVENT_RBUTTONUP;
+							_queuedInputEvent.mouse.x = _mouseX;
+							_queuedInputEvent.mouse.y = _mouseY;
+							_lastSecondaryTap = curTime;
+							_needEventRestPeriod = true;
+						}
+					}
+					if (_mouseClickAndDragEnabled) {
+						event.type = Common::EVENT_RBUTTONUP;
+						event.mouse.x = _mouseX;
+						event.mouse.y = _mouseY;
+					} 
+				} 
 				break;
 			case kInputOrientationChanged:
 				bool newModeIsLandscape = (int)xUnit != 1;


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