From 7989e9e6bcc56a4cbc6a378ba176d894ee427fc6 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 4 Feb 2014 20:52:15 +0100 Subject: [PATCH] Do not select stereo display debugger when HMD is set to Auto in Snowballs --- code/nel/include/nel/3d/stereo_display.h | 1 + code/nel/src/3d/stereo_debugger.cpp | 1 + code/nel/src/3d/stereo_libvr.cpp | 1 + code/nel/src/3d/stereo_ovr.cpp | 1 + code/snowballs2/client/src/camera.cpp | 8 +++++++- 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/code/nel/include/nel/3d/stereo_display.h b/code/nel/include/nel/3d/stereo_display.h index e3b5b3716..3b9c73b74 100644 --- a/code/nel/include/nel/3d/stereo_display.h +++ b/code/nel/include/nel/3d/stereo_display.h @@ -77,6 +77,7 @@ public: std::string Manufacturer; std::string ProductName; std::string Serial; // A unique device identifier + bool AllowAuto; // Allow this device to be automatically selected when no device is configured }; /** diff --git a/code/nel/src/3d/stereo_debugger.cpp b/code/nel/src/3d/stereo_debugger.cpp index c5c5e262a..34a348c80 100644 --- a/code/nel/src/3d/stereo_debugger.cpp +++ b/code/nel/src/3d/stereo_debugger.cpp @@ -453,6 +453,7 @@ void CStereoDebugger::listDevices(std::vector &devicesOut) devInfo.Manufacturer = "NeL"; devInfo.ProductName = "Stereo Debugger"; devInfo.Serial = "NL-3D-DEBUG"; + devInfo.AllowAuto = false; devicesOut.push_back(devInfo); } diff --git a/code/nel/src/3d/stereo_libvr.cpp b/code/nel/src/3d/stereo_libvr.cpp index 8ce64e07c..44a5a0a5a 100644 --- a/code/nel/src/3d/stereo_libvr.cpp +++ b/code/nel/src/3d/stereo_libvr.cpp @@ -612,6 +612,7 @@ void CStereoLibVR::listDevices(std::vector &devicesOut) deviceInfoOut.Factory = static_cast(handle); deviceInfoOut.Class = CStereoDeviceInfo::StereoHMD; deviceInfoOut.Library = CStereoDeviceInfo::LibVR; + deviceInfoOut.AllowAuto = true; //TODO: manufacturer, produc name //TODO: serial devicesOut.push_back(deviceInfoOut); diff --git a/code/nel/src/3d/stereo_ovr.cpp b/code/nel/src/3d/stereo_ovr.cpp index 46a8d147c..402d9b2d0 100644 --- a/code/nel/src/3d/stereo_ovr.cpp +++ b/code/nel/src/3d/stereo_ovr.cpp @@ -816,6 +816,7 @@ void CStereoOVR::listDevices(std::vector &devicesOut) deviceInfoOut.Library = CStereoDeviceInfo::OVR; // "Oculus SDK"; deviceInfoOut.Manufacturer = deviceInfo.Manufacturer; deviceInfoOut.ProductName = deviceInfo.ProductName; + deviceInfoOut.AllowAuto = true; stringstream ser; ser << id; deviceInfoOut.Serial = ser.str(); // can't get the real serial from the sdk... diff --git a/code/snowballs2/client/src/camera.cpp b/code/snowballs2/client/src/camera.cpp index 28ce273bb..9d9a5f777 100644 --- a/code/snowballs2/client/src/camera.cpp +++ b/code/snowballs2/client/src/camera.cpp @@ -94,7 +94,13 @@ void initCamera() if (hmdDeviceCfg == std::string("Auto") && devices.begin() != devices.end()) { - deviceInfo = &devices[0]; + for (std::vector::iterator it(devices.begin()), end(devices.end()); it != end; ++it) + { + if (it->AllowAuto) + { + deviceInfo = &devices[0]; + } + } } else {