Several fixes

- Ensure Auto Map and HUD display correctly
- Ensure virtual screen is always shown in front of player
- Restore working Thumbstick click
- Reduce chances of frame submission occurring in the wrong order
This commit is contained in:
Simon 2022-12-30 21:05:01 +00:00
parent 3ea7df9cc3
commit 6f86d67fdc
5 changed files with 17 additions and 10 deletions

View file

@ -418,19 +418,19 @@ void TBXR_UpdateControllers( )
if (GetActionStateBoolean(buttonYAction).currentState) leftTrackedRemoteState_new.Buttons |= xrButton_Y;
leftTrackedRemoteState_new.GripTrigger = GetActionStateFloat(gripLeftAction).currentState;
if (leftTrackedRemoteState_new.GripTrigger > 0.5f) leftTrackedRemoteState_new.Buttons |= xrButton_GripTrigger;
if (GetActionStateBoolean(thumbstickLeftClickAction).currentState) leftTrackedRemoteState_new.Buttons |= xrButton_LThumb;
if (GetActionStateBoolean(thumbstickLeftClickAction).currentState) leftTrackedRemoteState_new.Buttons |= xrButton_Joystick;
if (GetActionStateBoolean(buttonAAction).currentState) rightTrackedRemoteState_new.Buttons |= xrButton_A;
if (GetActionStateBoolean(buttonBAction).currentState) rightTrackedRemoteState_new.Buttons |= xrButton_B;
rightTrackedRemoteState_new.GripTrigger = GetActionStateFloat(gripRightAction).currentState;
if (rightTrackedRemoteState_new.GripTrigger > 0.5f) rightTrackedRemoteState_new.Buttons |= xrButton_GripTrigger;
if (GetActionStateBoolean(thumbstickRightClickAction).currentState) rightTrackedRemoteState_new.Buttons |= xrButton_RThumb;
if (GetActionStateBoolean(thumbstickRightClickAction).currentState) rightTrackedRemoteState_new.Buttons |= xrButton_Joystick;
//index finger click
if (GetActionStateBoolean(indexLeftAction).currentState) leftTrackedRemoteState_new.Buttons |= xrButton_Trigger;
if (GetActionStateBoolean(indexRightAction).currentState) rightTrackedRemoteState_new.Buttons |= xrButton_Trigger;
//Thumbrest touch
//Thumbrest
if (GetActionStateBoolean(thumbrestLeftTouchAction).currentState) leftTrackedRemoteState_new.Touches |= xrButton_ThumbRest;
if (GetActionStateBoolean(thumbrestRightTouchAction).currentState) rightTrackedRemoteState_new.Touches |= xrButton_ThumbRest;

View file

@ -549,7 +549,7 @@ void TBXR_UpdateControllers( )
if (GetActionStateBoolean(XAction, SIDE_LEFT).currentState) leftTrackedRemoteState_new.Buttons |= xrButton_X;
if (GetActionStateBoolean(YAction, SIDE_LEFT).currentState) leftTrackedRemoteState_new.Buttons |= xrButton_Y;
if (GetActionStateBoolean(sideAction, SIDE_LEFT).currentState) leftTrackedRemoteState_new.Buttons |= xrButton_GripTrigger;
if (GetActionStateBoolean(touchpadAction, SIDE_LEFT).currentState) leftTrackedRemoteState_new.Buttons |= xrButton_LThumb;
if (GetActionStateBoolean(touchpadAction, SIDE_LEFT).currentState) leftTrackedRemoteState_new.Buttons |= xrButton_Joystick;
if (GetActionStateFloat(triggerAction, SIDE_LEFT).currentState > 0.5f) leftTrackedRemoteState_new.Buttons |= xrButton_Trigger;
if (GetActionStateBoolean(ThumbrestTouchAction, SIDE_LEFT).currentState) leftTrackedRemoteState_new.Touches |= xrButton_ThumbRest;
@ -560,7 +560,7 @@ void TBXR_UpdateControllers( )
if (GetActionStateBoolean(AAction, SIDE_RIGHT).currentState) rightTrackedRemoteState_new.Buttons |= xrButton_A;
if (GetActionStateBoolean(BAction, SIDE_RIGHT).currentState) rightTrackedRemoteState_new.Buttons |= xrButton_B;
if (GetActionStateBoolean(sideAction, SIDE_RIGHT).currentState) rightTrackedRemoteState_new.Buttons |= xrButton_GripTrigger;
if (GetActionStateBoolean(touchpadAction, SIDE_RIGHT).currentState) rightTrackedRemoteState_new.Buttons |= xrButton_RThumb;
if (GetActionStateBoolean(touchpadAction, SIDE_RIGHT).currentState) rightTrackedRemoteState_new.Buttons |= xrButton_Joystick;
if (GetActionStateFloat(triggerAction, SIDE_RIGHT).currentState > 0.5f) rightTrackedRemoteState_new.Buttons |= xrButton_Trigger;
if (GetActionStateBoolean(ThumbrestTouchAction, SIDE_RIGHT).currentState) rightTrackedRemoteState_new.Touches |= xrButton_ThumbRest;

View file

@ -1669,6 +1669,7 @@ void TBXR_Recenter() {
loc.type = XR_TYPE_SPACE_LOCATION;
OXR(xrLocateSpace(gAppState.HeadSpace, gAppState.CurrentSpace, gAppState.PredictedDisplayTime, &loc));
QuatToYawPitchRoll(loc.pose.orientation, rotation, hmdorientation);
playerYaw = hmdorientation[YAW];
spaceCreateInfo.poseInReferenceSpace.orientation.x = 0;
spaceCreateInfo.poseInReferenceSpace.orientation.y = 0;
@ -1756,7 +1757,7 @@ static void TBXR_GetHMDOrientation() {
//All the stuff we want to do each frame
void TBXR_FrameSetup()
{
if (gAppState.FrameSetup)
if (gAppState.FrameSetupRefCount > 0)
{
return;
}
@ -1829,7 +1830,7 @@ void TBXR_FrameSetup()
TBXR_ProcessHaptics();
gAppState.FrameSetup = true;
gAppState.FrameSetupRefCount++;
}
int TBXR_GetRefresh()
@ -1918,6 +1919,12 @@ void TBXR_submitFrame()
return;
}
if (gAppState.FrameSetupRefCount == 0)
{
ALOGE("TBXR_submitFrame called with gAppState.FrameSetupRefCount == 0");
return;
}
TBXR_updateProjections();
XrFovf fov = {};
@ -2016,5 +2023,5 @@ void TBXR_submitFrame()
OXR(xrEndFrame(gAppState.Session, &endFrameInfo));
gAppState.FrameSetup = false;
gAppState.FrameSetupRefCount--;
}

View file

@ -223,7 +223,7 @@ typedef struct
ANativeWindow* NativeWindow;
bool Resumed;
bool Focused;
bool FrameSetup;
int FrameSetupRefCount;
float Width;
float Height;

@ -1 +1 @@
Subproject commit 232492121898049ef54155d193bd563ad6955a05
Subproject commit e813c7adec5578b1385f641962af1dc803046d84