mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-21 19:51:33 +00:00
Fix crash on quest firmware v53
This commit is contained in:
parent
1764c82c59
commit
bde413658b
1 changed files with 24 additions and 9 deletions
|
@ -17,7 +17,7 @@ XrResult CheckXrResult(XrResult res, const char* originator) {
|
|||
#define SIDE_COUNT 2
|
||||
|
||||
|
||||
XrActionSet actionSet;
|
||||
XrActionSet actionSet = nullptr;
|
||||
XrAction grabAction;
|
||||
XrAction poseAction;
|
||||
XrAction vibrateAction;
|
||||
|
@ -64,11 +64,13 @@ XrActionStateBoolean GetActionStateBoolean(XrAction action, int hand) {
|
|||
XrActionStateGetInfo getInfo = {};
|
||||
getInfo.type = XR_TYPE_ACTION_STATE_GET_INFO;
|
||||
getInfo.action = action;
|
||||
getInfo.next = NULL;
|
||||
if (hand >= 0)
|
||||
getInfo.subactionPath = handSubactionPath[hand];
|
||||
|
||||
XrActionStateBoolean state = {};
|
||||
state.type = XR_TYPE_ACTION_STATE_BOOLEAN;
|
||||
state.next = NULL;
|
||||
CHECK_XRCMD(xrGetActionStateBoolean(gAppState.Session, &getInfo, &state));
|
||||
return state;
|
||||
}
|
||||
|
@ -77,11 +79,13 @@ XrActionStateFloat GetActionStateFloat(XrAction action, int hand) {
|
|||
XrActionStateGetInfo getInfo = {};
|
||||
getInfo.type = XR_TYPE_ACTION_STATE_GET_INFO;
|
||||
getInfo.action = action;
|
||||
getInfo.next = NULL;
|
||||
if (hand >= 0)
|
||||
getInfo.subactionPath = handSubactionPath[hand];
|
||||
|
||||
XrActionStateFloat state = {};
|
||||
state.type = XR_TYPE_ACTION_STATE_FLOAT;
|
||||
state.next = NULL;
|
||||
CHECK_XRCMD(xrGetActionStateFloat(gAppState.Session, &getInfo, &state));
|
||||
return state;
|
||||
}
|
||||
|
@ -90,11 +94,13 @@ XrActionStateVector2f GetActionStateVector2(XrAction action, int hand) {
|
|||
XrActionStateGetInfo getInfo = {};
|
||||
getInfo.type = XR_TYPE_ACTION_STATE_GET_INFO;
|
||||
getInfo.action = action;
|
||||
getInfo.next = NULL;
|
||||
if (hand >= 0)
|
||||
getInfo.subactionPath = handSubactionPath[hand];
|
||||
|
||||
XrActionStateVector2f state = {};
|
||||
state.type = XR_TYPE_ACTION_STATE_VECTOR2F;
|
||||
state.next = NULL;
|
||||
CHECK_XRCMD(xrGetActionStateVector2f(gAppState.Session, &getInfo, &state));
|
||||
return state;
|
||||
}
|
||||
|
@ -132,6 +138,7 @@ void TBXR_InitActions( void )
|
|||
strcpy(actionSetInfo.actionSetName, "gameplay");
|
||||
strcpy(actionSetInfo.localizedActionSetName, "Gameplay");
|
||||
actionSetInfo.priority = 0;
|
||||
actionSetInfo.next = NULL;
|
||||
CHECK_XRCMD(xrCreateActionSet(gAppState.Instance, &actionSetInfo, &actionSet));
|
||||
}
|
||||
|
||||
|
@ -325,6 +332,7 @@ void TBXR_InitActions( void )
|
|||
suggestedBindings.interactionProfile = picoMixedRealityInteractionProfilePath;
|
||||
suggestedBindings.suggestedBindings = bindings;
|
||||
suggestedBindings.countSuggestedBindings = currBinding;
|
||||
suggestedBindings.next = NULL;
|
||||
result = xrSuggestInteractionProfileBindings(gAppState.Instance, &suggestedBindings);
|
||||
}
|
||||
|
||||
|
@ -376,6 +384,7 @@ void TBXR_InitActions( void )
|
|||
suggestedBindings.interactionProfile = touchControllerInteractionProfilePath;
|
||||
suggestedBindings.suggestedBindings = bindings;
|
||||
suggestedBindings.countSuggestedBindings = currBinding;
|
||||
suggestedBindings.next = NULL;
|
||||
result = xrSuggestInteractionProfileBindings(gAppState.Instance, &suggestedBindings);
|
||||
}
|
||||
|
||||
|
@ -392,17 +401,21 @@ void TBXR_InitActions( void )
|
|||
actionSpaceInfo.subactionPath = handSubactionPath[SIDE_LEFT];
|
||||
CHECK_XRCMD(xrCreateActionSpace(gAppState.Session, &actionSpaceInfo, &aimSpace[SIDE_LEFT]));
|
||||
actionSpaceInfo.subactionPath = handSubactionPath[SIDE_RIGHT];
|
||||
actionSpaceInfo.next = NULL;
|
||||
CHECK_XRCMD(xrCreateActionSpace(gAppState.Session, &actionSpaceInfo, &aimSpace[SIDE_RIGHT]));
|
||||
|
||||
XrSessionActionSetsAttachInfo attachInfo = {};
|
||||
attachInfo.type = XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO;
|
||||
attachInfo.countActionSets = 1;
|
||||
attachInfo.actionSets = &actionSet;
|
||||
attachInfo.next = NULL;
|
||||
CHECK_XRCMD(xrAttachSessionActionSets(gAppState.Session, &attachInfo));
|
||||
}
|
||||
|
||||
void TBXR_SyncActions( void )
|
||||
{
|
||||
if (actionSet)
|
||||
{
|
||||
XrActiveActionSet activeActionSet = {};
|
||||
activeActionSet.actionSet = actionSet;
|
||||
activeActionSet.subactionPath = XR_NULL_PATH;
|
||||
|
@ -410,7 +423,9 @@ void TBXR_SyncActions( void )
|
|||
syncInfo.type = XR_TYPE_ACTIONS_SYNC_INFO;
|
||||
syncInfo.countActiveActionSets = 1;
|
||||
syncInfo.activeActionSets = &activeActionSet;
|
||||
syncInfo.next = NULL;
|
||||
CHECK_XRCMD(xrSyncActions(gAppState.Session, &syncInfo));
|
||||
}
|
||||
}
|
||||
|
||||
void TBXR_UpdateControllers( )
|
||||
|
|
Loading…
Reference in a new issue