Fix bug where L3/R3 touch was passed through to become a mouse click

This commit is contained in:
Cameron Gutman
2015-01-09 23:43:11 -05:00
parent 3190c61a0a
commit 514d5d13a0
+10 -1
View File
@@ -627,6 +627,7 @@ static float L3_Y;
- (BOOL)handleTouchUpEvent:touches { - (BOOL)handleTouchUpEvent:touches {
BOOL updated = false; BOOL updated = false;
BOOL touched = false;
for (UITouch* touch in touches) { for (UITouch* touch in touches) {
if (touch == _aTouch) { if (touch == _aTouch) {
[_controllerSupport clearButtonFlag:A_FLAG]; [_controllerSupport clearButtonFlag:A_FLAG];
@@ -699,11 +700,19 @@ static float L3_Y;
_rsTouch = nil; _rsTouch = nil;
updated = true; updated = true;
} }
else if (touch == _l3Touch) {
_l3Touch = nil;
touched = true;
}
else if (touch == _r3Touch) {
_r3Touch = nil;
touched = true;
}
} }
if (updated) { if (updated) {
[_controllerSupport updateFinished]; [_controllerSupport updateFinished];
} }
return updated; return updated || touched;
} }
@end @end