Skip to content

Commit

Permalink
Fix crash with X-Plane 12.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbucchia committed Sep 9, 2023
1 parent d1cac94 commit 9cee08c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pimax-openxr/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ namespace pimax_openxr {
m_sessionCreated = true;

// FIXME: Reset the session and frame state here.
m_frameWaited = m_frameBegun = m_frameCompleted = 0;

m_sessionState = XR_SESSION_STATE_IDLE;
updateSessionState(true);

m_frameWaited = m_frameBegun = m_frameCompleted = 0;

m_frameTimes.clear();

m_isControllerActive[0] = m_isControllerActive[1] = false;
Expand Down
5 changes: 4 additions & 1 deletion pimax-openxr/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,14 @@ namespace pimax_openxr {
const float cantingAngle = PVR::Quatf{m_cachedEyeInfo[xr::StereoView::Left].HmdToEyePose.Orientation}.Angle(
m_cachedEyeInfo[xr::StereoView::Right].HmdToEyePose.Orientation) /
2.f;
const bool wasUsingParallelProjection = m_useParallelProjection;
m_useParallelProjection =
cantingAngle > 0.0001f && getSetting("force_parallel_projection_state")
.value_or(!pvr_getIntConfig(m_pvrSession, "steamvr_use_native_fov", 0));
if (m_useParallelProjection) {
Log("Parallel projection is enabled\n");
if (!wasUsingParallelProjection) {
Log("Parallel projection is enabled\n");
}

// Per Pimax, we must set this value for parallel projection to work properly.
CHECK_PVRCMD(pvr_setIntConfig(m_pvrSession, "view_rotation_fix", 1));
Expand Down

0 comments on commit 9cee08c

Please sign in to comment.