mirror of
https://github.com/DrBeef/QuakeQuest.git
synced 2024-11-25 05:21:48 +00:00
Fix crash on quest firmware v53
This commit is contained in:
parent
e8a6928ce9
commit
1d7aecfa26
1 changed files with 24 additions and 9 deletions
|
@ -16,7 +16,7 @@ XrResult CheckXrResult(XrResult res, const char* originator) {
|
||||||
#define SIDE_COUNT 2
|
#define SIDE_COUNT 2
|
||||||
|
|
||||||
|
|
||||||
XrActionSet actionSet;
|
XrActionSet actionSet = NULL;
|
||||||
XrAction grabAction = 0;
|
XrAction grabAction = 0;
|
||||||
XrAction poseAction = 0;
|
XrAction poseAction = 0;
|
||||||
XrAction vibrateAction = 0;
|
XrAction vibrateAction = 0;
|
||||||
|
@ -63,11 +63,13 @@ XrActionStateBoolean GetActionStateBoolean(XrAction action, int hand) {
|
||||||
XrActionStateGetInfo getInfo = {};
|
XrActionStateGetInfo getInfo = {};
|
||||||
getInfo.type = XR_TYPE_ACTION_STATE_GET_INFO;
|
getInfo.type = XR_TYPE_ACTION_STATE_GET_INFO;
|
||||||
getInfo.action = action;
|
getInfo.action = action;
|
||||||
|
getInfo.next = NULL;
|
||||||
if (hand >= 0)
|
if (hand >= 0)
|
||||||
getInfo.subactionPath = handSubactionPath[hand];
|
getInfo.subactionPath = handSubactionPath[hand];
|
||||||
|
|
||||||
XrActionStateBoolean state = {};
|
XrActionStateBoolean state = {};
|
||||||
state.type = XR_TYPE_ACTION_STATE_BOOLEAN;
|
state.type = XR_TYPE_ACTION_STATE_BOOLEAN;
|
||||||
|
state.next = NULL;
|
||||||
CHECK_XRCMD(xrGetActionStateBoolean(gAppState.Session, &getInfo, &state));
|
CHECK_XRCMD(xrGetActionStateBoolean(gAppState.Session, &getInfo, &state));
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -76,11 +78,13 @@ XrActionStateFloat GetActionStateFloat(XrAction action, int hand) {
|
||||||
XrActionStateGetInfo getInfo = {};
|
XrActionStateGetInfo getInfo = {};
|
||||||
getInfo.type = XR_TYPE_ACTION_STATE_GET_INFO;
|
getInfo.type = XR_TYPE_ACTION_STATE_GET_INFO;
|
||||||
getInfo.action = action;
|
getInfo.action = action;
|
||||||
|
getInfo.next = NULL;
|
||||||
if (hand >= 0)
|
if (hand >= 0)
|
||||||
getInfo.subactionPath = handSubactionPath[hand];
|
getInfo.subactionPath = handSubactionPath[hand];
|
||||||
|
|
||||||
XrActionStateFloat state = {};
|
XrActionStateFloat state = {};
|
||||||
state.type = XR_TYPE_ACTION_STATE_FLOAT;
|
state.type = XR_TYPE_ACTION_STATE_FLOAT;
|
||||||
|
state.next = NULL;
|
||||||
CHECK_XRCMD(xrGetActionStateFloat(gAppState.Session, &getInfo, &state));
|
CHECK_XRCMD(xrGetActionStateFloat(gAppState.Session, &getInfo, &state));
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -89,11 +93,13 @@ XrActionStateVector2f GetActionStateVector2(XrAction action, int hand) {
|
||||||
XrActionStateGetInfo getInfo = {};
|
XrActionStateGetInfo getInfo = {};
|
||||||
getInfo.type = XR_TYPE_ACTION_STATE_GET_INFO;
|
getInfo.type = XR_TYPE_ACTION_STATE_GET_INFO;
|
||||||
getInfo.action = action;
|
getInfo.action = action;
|
||||||
|
getInfo.next = NULL;
|
||||||
if (hand >= 0)
|
if (hand >= 0)
|
||||||
getInfo.subactionPath = handSubactionPath[hand];
|
getInfo.subactionPath = handSubactionPath[hand];
|
||||||
|
|
||||||
XrActionStateVector2f state = {};
|
XrActionStateVector2f state = {};
|
||||||
state.type = XR_TYPE_ACTION_STATE_VECTOR2F;
|
state.type = XR_TYPE_ACTION_STATE_VECTOR2F;
|
||||||
|
state.next = NULL;
|
||||||
CHECK_XRCMD(xrGetActionStateVector2f(gAppState.Session, &getInfo, &state));
|
CHECK_XRCMD(xrGetActionStateVector2f(gAppState.Session, &getInfo, &state));
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -131,6 +137,7 @@ void TBXR_InitActions( void )
|
||||||
strcpy(actionSetInfo.actionSetName, "gameplay");
|
strcpy(actionSetInfo.actionSetName, "gameplay");
|
||||||
strcpy(actionSetInfo.localizedActionSetName, "Gameplay");
|
strcpy(actionSetInfo.localizedActionSetName, "Gameplay");
|
||||||
actionSetInfo.priority = 0;
|
actionSetInfo.priority = 0;
|
||||||
|
actionSetInfo.next = NULL;
|
||||||
CHECK_XRCMD(xrCreateActionSet(gAppState.Instance, &actionSetInfo, &actionSet));
|
CHECK_XRCMD(xrCreateActionSet(gAppState.Instance, &actionSetInfo, &actionSet));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,6 +331,7 @@ void TBXR_InitActions( void )
|
||||||
suggestedBindings.interactionProfile = picoMixedRealityInteractionProfilePath;
|
suggestedBindings.interactionProfile = picoMixedRealityInteractionProfilePath;
|
||||||
suggestedBindings.suggestedBindings = bindings;
|
suggestedBindings.suggestedBindings = bindings;
|
||||||
suggestedBindings.countSuggestedBindings = currBinding;
|
suggestedBindings.countSuggestedBindings = currBinding;
|
||||||
|
suggestedBindings.next = NULL;
|
||||||
result = xrSuggestInteractionProfileBindings(gAppState.Instance, &suggestedBindings);
|
result = xrSuggestInteractionProfileBindings(gAppState.Instance, &suggestedBindings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,6 +383,7 @@ void TBXR_InitActions( void )
|
||||||
suggestedBindings.interactionProfile = touchControllerInteractionProfilePath;
|
suggestedBindings.interactionProfile = touchControllerInteractionProfilePath;
|
||||||
suggestedBindings.suggestedBindings = bindings;
|
suggestedBindings.suggestedBindings = bindings;
|
||||||
suggestedBindings.countSuggestedBindings = currBinding;
|
suggestedBindings.countSuggestedBindings = currBinding;
|
||||||
|
suggestedBindings.next = NULL;
|
||||||
result = xrSuggestInteractionProfileBindings(gAppState.Instance, &suggestedBindings);
|
result = xrSuggestInteractionProfileBindings(gAppState.Instance, &suggestedBindings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,25 +400,31 @@ void TBXR_InitActions( void )
|
||||||
actionSpaceInfo.subactionPath = handSubactionPath[SIDE_LEFT];
|
actionSpaceInfo.subactionPath = handSubactionPath[SIDE_LEFT];
|
||||||
CHECK_XRCMD(xrCreateActionSpace(gAppState.Session, &actionSpaceInfo, &aimSpace[SIDE_LEFT]));
|
CHECK_XRCMD(xrCreateActionSpace(gAppState.Session, &actionSpaceInfo, &aimSpace[SIDE_LEFT]));
|
||||||
actionSpaceInfo.subactionPath = handSubactionPath[SIDE_RIGHT];
|
actionSpaceInfo.subactionPath = handSubactionPath[SIDE_RIGHT];
|
||||||
|
actionSpaceInfo.next = NULL;
|
||||||
CHECK_XRCMD(xrCreateActionSpace(gAppState.Session, &actionSpaceInfo, &aimSpace[SIDE_RIGHT]));
|
CHECK_XRCMD(xrCreateActionSpace(gAppState.Session, &actionSpaceInfo, &aimSpace[SIDE_RIGHT]));
|
||||||
|
|
||||||
XrSessionActionSetsAttachInfo attachInfo = {};
|
XrSessionActionSetsAttachInfo attachInfo = {};
|
||||||
attachInfo.type = XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO;
|
attachInfo.type = XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO;
|
||||||
attachInfo.countActionSets = 1;
|
attachInfo.countActionSets = 1;
|
||||||
attachInfo.actionSets = &actionSet;
|
attachInfo.actionSets = &actionSet;
|
||||||
|
attachInfo.next = NULL;
|
||||||
CHECK_XRCMD(xrAttachSessionActionSets(gAppState.Session, &attachInfo));
|
CHECK_XRCMD(xrAttachSessionActionSets(gAppState.Session, &attachInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TBXR_SyncActions( void )
|
void TBXR_SyncActions( void )
|
||||||
{
|
{
|
||||||
XrActiveActionSet activeActionSet = {};
|
if (actionSet)
|
||||||
activeActionSet.actionSet = actionSet;
|
{
|
||||||
activeActionSet.subactionPath = XR_NULL_PATH;
|
XrActiveActionSet activeActionSet = {};
|
||||||
XrActionsSyncInfo syncInfo;
|
activeActionSet.actionSet = actionSet;
|
||||||
syncInfo.type = XR_TYPE_ACTIONS_SYNC_INFO;
|
activeActionSet.subactionPath = XR_NULL_PATH;
|
||||||
syncInfo.countActiveActionSets = 1;
|
XrActionsSyncInfo syncInfo;
|
||||||
syncInfo.activeActionSets = &activeActionSet;
|
syncInfo.type = XR_TYPE_ACTIONS_SYNC_INFO;
|
||||||
CHECK_XRCMD(xrSyncActions(gAppState.Session, &syncInfo));
|
syncInfo.countActiveActionSets = 1;
|
||||||
|
syncInfo.activeActionSets = &activeActionSet;
|
||||||
|
syncInfo.next = NULL;
|
||||||
|
CHECK_XRCMD(xrSyncActions(gAppState.Session, &syncInfo));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TBXR_UpdateControllers( )
|
void TBXR_UpdateControllers( )
|
||||||
|
|
Loading…
Reference in a new issue