tangled
alpha
login
or
join now
matrixfurry.com
/
monado
0
fork
atom
The open source OpenXR runtime
0
fork
atom
overview
issues
pulls
pipelines
t/common: Refactor SimulaVR builder [NFC]
Jakob Bornecrantz
2 years ago
0a8fa312
201ea799
+14
-7
1 changed file
expand all
collapse all
unified
split
src
xrt
targets
common
target_builder_simulavr.c
+14
-7
src/xrt/targets/common/target_builder_simulavr.c
···
192
192
struct xrt_space_overseer **out_xso)
193
193
{
194
194
struct simula_builder *sb = (struct simula_builder *)xb;
195
195
-
struct u_system_devices *usysd = u_system_devices_allocate();
196
195
xrt_result_t result = XRT_SUCCESS;
197
196
198
197
if (out_xsysd == NULL || *out_xsysd != NULL) {
···
211
210
struct xrt_device *head_device = multi_create_tracking_override(
212
211
XRT_TRACKING_OVERRIDE_ATTACHED, svr_dev, t265_dev, XRT_INPUT_GENERIC_TRACKER_POSE, &ident);
213
212
214
214
-
usysd->base.roles.head = head_device;
215
215
-
usysd->base.xdevs[0] = usysd->base.roles.head;
216
216
-
usysd->base.xdev_count = 1;
213
213
+
struct xrt_system_devices *xsysd = NULL;
214
214
+
{
215
215
+
struct u_system_devices *usysd = u_system_devices_allocate();
216
216
+
xsysd = &usysd->base;
217
217
+
}
218
218
+
219
219
+
// Add to device list.
220
220
+
xsysd->xdevs[xsysd->xdev_count++] = head_device;
221
221
+
222
222
+
// Assign to role(s).
223
223
+
xsysd->roles.head = head_device;
217
224
218
225
219
226
end:
220
227
if (result == XRT_SUCCESS) {
221
221
-
*out_xsysd = &usysd->base;
222
222
-
u_builder_create_space_overseer(&usysd->base, out_xso);
228
228
+
*out_xsysd = xsysd;
229
229
+
u_builder_create_space_overseer(xsysd, out_xso);
223
230
} else {
224
224
-
u_system_devices_destroy(&usysd);
231
231
+
xrt_system_devices_destroy(&xsysd);
225
232
}
226
233
227
234
return result;