mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Fix touch screen flip
This commit is contained in:
@@ -344,6 +344,9 @@ void GetInput (gliderPtr thisGlider)
|
||||
|
||||
if (thisMac.isTouchscreen)
|
||||
{
|
||||
bool touchLeftState = false;
|
||||
bool touchRightState = false;
|
||||
|
||||
for (int fi = 0; fi < touchScreenControlState::kMaxFingers; fi++)
|
||||
{
|
||||
const touchScreenFingerState &fstate = touchScreen.fingers[fi];
|
||||
@@ -360,21 +363,10 @@ void GetInput (gliderPtr thisGlider)
|
||||
case TouchScreenCtrlIDs::Movement:
|
||||
{
|
||||
int32_t screenWidth = mainWindowRect.Width();
|
||||
const bool touchLeftState = (touchScreenPoint.h * 2 <= screenWidth);
|
||||
const bool touchRightState = (touchScreenPoint.h * 2 - screenWidth >= 0);
|
||||
|
||||
if (touchLeftState)
|
||||
{
|
||||
if (touchRightState)
|
||||
continuousFlipState = true;
|
||||
else
|
||||
leftState = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (touchRightState)
|
||||
rightState = true;
|
||||
}
|
||||
if (touchScreenPoint.h * 2 <= screenWidth)
|
||||
touchLeftState = true;
|
||||
if (touchScreenPoint.h * 2 - screenWidth >= 0)
|
||||
touchRightState = true;
|
||||
}
|
||||
break;
|
||||
case TouchScreenCtrlIDs::Flip:
|
||||
@@ -390,6 +382,16 @@ void GetInput (gliderPtr thisGlider)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (touchLeftState)
|
||||
{
|
||||
if (touchRightState)
|
||||
continuousFlipState = true;
|
||||
else
|
||||
leftState = true;
|
||||
}
|
||||
else if (touchRightState)
|
||||
rightState = true;
|
||||
}
|
||||
|
||||
if (theKeys->IsSet(thisGlider->gamepadRightKey))
|
||||
|
Reference in New Issue
Block a user