Skip to content

Commit 04e3590

Browse files
committed
Search universes in Prop_DriverProvidedChaperoneJson_String
1 parent a9df23e commit 04e3590

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

libraries/openvr

Submodule openvr updated 191 files

src/VRDriver.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,21 @@ std::optional<SlimeVRDriver::UniverseTranslation> SlimeVRDriver::VRDriver::Searc
409409
}
410410

411411
std::optional<SlimeVRDriver::UniverseTranslation> SlimeVRDriver::VRDriver::SearchUniverses(uint64_t target) {
412-
auto driver_chap_path = vr::VRProperties()->GetStringProperty(vr::VRProperties()->TrackedDeviceToPropertyContainer(0), vr::Prop_DriverProvidedChaperonePath_String);
412+
vr::PropertyContainerHandle_t hmd_prop_container = vr::VRProperties()->TrackedDeviceToPropertyContainer(vr::k_unTrackedDeviceIndex_Hmd);
413+
auto driver_chap_json = vr::VRProperties()->GetStringProperty(hmd_prop_container, vr::Prop_DriverProvidedChaperoneJson_String);
414+
if (driver_chap_json != "") {
415+
try {
416+
auto driver_res = SearchUniverse(driver_chap_json, target);
417+
if (driver_res.has_value()) {
418+
return driver_res.value();
419+
}
420+
}
421+
catch (simdjson::simdjson_error &e) {
422+
logger_->Log("Error loading driver-provided chaperone JSON: {}", e.what());
423+
}
424+
}
425+
426+
auto driver_chap_path = vr::VRProperties()->GetStringProperty(hmd_prop_container, vr::Prop_DriverProvidedChaperonePath_String);
413427
if (driver_chap_path != "") {
414428
try {
415429
auto driver_res = SearchUniverse(simdjson::padded_string::load(driver_chap_path).take_value(), target);

0 commit comments

Comments
 (0)