mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:17:43 +02:00
Changed so it will fail to load VR straight away instead of trying so much it causes audio failures
This commit is contained in:
parent
6b5d1c6191
commit
7d402f4bae
1 changed files with 11 additions and 1 deletions
|
@ -108,9 +108,11 @@ QString getVrSettingString(const char* section, const char* setting) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int headsetNotConnected = -1;
|
||||||
|
|
||||||
vr::IVRSystem* acquireOpenVrSystem() {
|
vr::IVRSystem* acquireOpenVrSystem() {
|
||||||
bool hmdPresent = vr::VR_IsHmdPresent();
|
bool hmdPresent = vr::VR_IsHmdPresent();
|
||||||
if (hmdPresent) {
|
if (hmdPresent && (headsetNotConnected <= 0)) {
|
||||||
Lock lock(mutex);
|
Lock lock(mutex);
|
||||||
if (!activeHmd) {
|
if (!activeHmd) {
|
||||||
#if DEV_BUILD
|
#if DEV_BUILD
|
||||||
|
@ -122,6 +124,14 @@ vr::IVRSystem* acquireOpenVrSystem() {
|
||||||
#if DEV_BUILD
|
#if DEV_BUILD
|
||||||
qCDebug(displayplugins) << "OpenVR display: HMD is " << activeHmd << " error is " << eError;
|
qCDebug(displayplugins) << "OpenVR display: HMD is " << activeHmd << " error is " << eError;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (eError == 108) { // vr::HmdError_Init_HmdNotFound
|
||||||
|
headsetNotConnected = 1;
|
||||||
|
activeHmd = nullptr;
|
||||||
|
#if DEV_BUILD
|
||||||
|
qCDebug(displayplugins) << "OpenVR: No HMD connected, setting nullptr!";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (activeHmd) {
|
if (activeHmd) {
|
||||||
#if DEV_BUILD
|
#if DEV_BUILD
|
||||||
|
|
Loading…
Reference in a new issue