Skip to content

Commit

Permalink
Fix view flickering when exiting binoculars
Browse files Browse the repository at this point in the history
  • Loading branch information
fholger committed Aug 28, 2023
1 parent ec1b2a6 commit 5de90aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/CryGame C++/Solution1/CryGame/VRManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ void VRManager::FinishFrame()
IDirect3DTexture9 *tex = eye == 2 ? m_d3d->hudTexture.Get() : m_d3d->eyeTextures[eye].Get();
dxvkTransitionImageLayout(m_d3d->device.Get(), tex, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, origLayout[eye]);
}

m_wasBinocular = m_pGame->AreBinocularsActive();
}

vector2di VRManager::GetRenderSize() const
Expand Down Expand Up @@ -438,7 +440,7 @@ void VRManager::ModifyViewCamera(int eye, CCamera& cam)
return;
}

if (m_pGame->AreBinocularsActive())
if (m_pGame->AreBinocularsActive() || m_wasBinocular)
{
cam = m_binocularOriginalPlayerCam;
}
Expand Down
1 change: 1 addition & 0 deletions Sources/CryGame C++/Solution1/CryGame/VRManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class VRManager
Ang3 m_curBinocularAngles;
Vec3 m_curBinocularPos;
CCamera m_binocularOriginalPlayerCam;
bool m_wasBinocular = false;

void UpdateHmdTransform();
void ProcessRoomscale();
Expand Down

0 comments on commit 5de90aa

Please sign in to comment.