mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 03:59:36 +00:00
Redo touch controls
This commit is contained in:
@@ -366,7 +366,6 @@ namespace TouchScreenCtrlIDs
|
|||||||
{
|
{
|
||||||
enum TouchScreenCtrlID
|
enum TouchScreenCtrlID
|
||||||
{
|
{
|
||||||
Flip,
|
|
||||||
Bands,
|
Bands,
|
||||||
BatteryHelium,
|
BatteryHelium,
|
||||||
Movement,
|
Movement,
|
||||||
|
|||||||
@@ -369,9 +369,6 @@ void GetInput (gliderPtr thisGlider)
|
|||||||
touchRightState = true;
|
touchRightState = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TouchScreenCtrlIDs::Flip:
|
|
||||||
holdFlipState = true;
|
|
||||||
break;
|
|
||||||
case TouchScreenCtrlIDs::Bands:
|
case TouchScreenCtrlIDs::Bands:
|
||||||
bandsState = true;
|
bandsState = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -567,9 +567,8 @@ void ResetTouchScreenControlBounds (void)
|
|||||||
Point sizes[TouchScreenCtrlIDs::Count];
|
Point sizes[TouchScreenCtrlIDs::Count];
|
||||||
|
|
||||||
points[TouchScreenCtrlIDs::Movement] = Point::Create(mainWindowRect.left, mainWindowRect.top);
|
points[TouchScreenCtrlIDs::Movement] = Point::Create(mainWindowRect.left, mainWindowRect.top);
|
||||||
points[TouchScreenCtrlIDs::BatteryHelium] = Point::Create(mainWindowRect.right - touchScreenControlEdgeSpacing - touchScreenControlSize, mainWindowRect.bottom - touchScreenControlEdgeSpacing - touchScreenControlSize);
|
points[TouchScreenCtrlIDs::BatteryHelium] = Point::Create(mainWindowRect.left + touchScreenControlEdgeSpacing, mainWindowRect.top + touchScreenControlEdgeSpacing);
|
||||||
points[TouchScreenCtrlIDs::Flip] = points[TouchScreenCtrlIDs::BatteryHelium] + Point::Create(0, -touchScreenControlInterSpacing - touchScreenControlSize);
|
points[TouchScreenCtrlIDs::Bands] = Point::Create(mainWindowRect.right - touchScreenControlEdgeSpacing - touchScreenControlSize, mainWindowRect.top + touchScreenControlEdgeSpacing);
|
||||||
points[TouchScreenCtrlIDs::Bands] = points[TouchScreenCtrlIDs::BatteryHelium] + Point::Create(-touchScreenControlInterSpacing - touchScreenControlSize, 0);
|
|
||||||
|
|
||||||
for (int i = 0; i < TouchScreenCtrlIDs::Count; i++)
|
for (int i = 0; i < TouchScreenCtrlIDs::Count; i++)
|
||||||
sizes[i] = Point::Create(touchScreenControlSize, touchScreenControlSize);
|
sizes[i] = Point::Create(touchScreenControlSize, touchScreenControlSize);
|
||||||
@@ -625,7 +624,6 @@ void PlayGame (void)
|
|||||||
InitTouchScreenControlState();
|
InitTouchScreenControlState();
|
||||||
|
|
||||||
touchScreen.controls[TouchScreenCtrlIDs::Movement].isEnabled = true;
|
touchScreen.controls[TouchScreenCtrlIDs::Movement].isEnabled = true;
|
||||||
touchScreen.controls[TouchScreenCtrlIDs::Flip].isEnabled = true;
|
|
||||||
touchScreen.controls[TouchScreenCtrlIDs::Bands].isEnabled = true;
|
touchScreen.controls[TouchScreenCtrlIDs::Bands].isEnabled = true;
|
||||||
touchScreen.controls[TouchScreenCtrlIDs::BatteryHelium].isEnabled = true;
|
touchScreen.controls[TouchScreenCtrlIDs::BatteryHelium].isEnabled = true;
|
||||||
|
|
||||||
|
|||||||
@@ -616,7 +616,6 @@ void RenderTouchScreenControls (void)
|
|||||||
ctrlGraphics[i] = nullptr;
|
ctrlGraphics[i] = nullptr;
|
||||||
|
|
||||||
ctrlGraphics[TouchScreenCtrlIDs::Movement] = nullptr;
|
ctrlGraphics[TouchScreenCtrlIDs::Movement] = nullptr;
|
||||||
ctrlGraphics[TouchScreenCtrlIDs::Flip] = touchScreen.graphics[touchScreenControlGraphics::FlipIdle];
|
|
||||||
ctrlGraphics[TouchScreenCtrlIDs::Bands] = touchScreen.graphics[touchScreenControlGraphics::BandsDisabled];
|
ctrlGraphics[TouchScreenCtrlIDs::Bands] = touchScreen.graphics[touchScreenControlGraphics::BandsDisabled];
|
||||||
ctrlGraphics[TouchScreenCtrlIDs::BatteryHelium] = touchScreen.graphics[touchScreenControlGraphics::BatteryDisabled];
|
ctrlGraphics[TouchScreenCtrlIDs::BatteryHelium] = touchScreen.graphics[touchScreenControlGraphics::BatteryDisabled];
|
||||||
|
|
||||||
@@ -642,8 +641,6 @@ void RenderTouchScreenControls (void)
|
|||||||
if (bandsTotal > 0)
|
if (bandsTotal > 0)
|
||||||
ctrlGraphics[TouchScreenCtrlIDs::Bands] = touchScreen.graphics[touchScreenControlGraphics::BandsActive];
|
ctrlGraphics[TouchScreenCtrlIDs::Bands] = touchScreen.graphics[touchScreenControlGraphics::BandsActive];
|
||||||
}
|
}
|
||||||
else if (touchScreen.fingers[i].capturingControl == TouchScreenCtrlIDs::Flip)
|
|
||||||
ctrlGraphics[TouchScreenCtrlIDs::Flip] = touchScreen.graphics[touchScreenControlGraphics::FlipActive];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < TouchScreenCtrlIDs::Count; i++)
|
for (int i = 0; i < TouchScreenCtrlIDs::Count; i++)
|
||||||
|
|||||||
Reference in New Issue
Block a user