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