You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
[HTML5] Fix build (with module_webxr_enabled=no).
The XR API changed a bit, and it's not just a rename, though probably an easy update for someone who is qualified :).
This commit is contained in:
@@ -202,8 +202,8 @@ int WebXRInterfaceJS::get_capabilities() const {
|
||||
return XRInterface::XR_STEREO | XRInterface::XR_MONO;
|
||||
};
|
||||
|
||||
bool WebXRInterfaceJS::is_stereo() {
|
||||
return godot_webxr_get_view_count() == 2;
|
||||
uint32_t WebXRInterfaceJS::get_view_count() {
|
||||
return godot_webxr_get_view_count();
|
||||
};
|
||||
|
||||
bool WebXRInterfaceJS::is_initialized() const {
|
||||
@@ -425,7 +425,7 @@ void WebXRInterfaceJS::_update_tracker(int p_controller_id) {
|
||||
int *buttons = godot_webxr_get_controller_buttons(p_controller_id);
|
||||
if (buttons) {
|
||||
for (int i = 0; i < buttons[0]; i++) {
|
||||
input->joy_button(p_controller_id + 100, i, *((float *)buttons + (i + 1)));
|
||||
input->joy_button(p_controller_id + 100, (JoyButton)i, *((float *)buttons + (i + 1)));
|
||||
}
|
||||
free(buttons);
|
||||
}
|
||||
@@ -436,7 +436,7 @@ void WebXRInterfaceJS::_update_tracker(int p_controller_id) {
|
||||
Input::JoyAxisValue joy_axis;
|
||||
joy_axis.min = -1;
|
||||
joy_axis.value = *((float *)axes + (i + 1));
|
||||
input->joy_axis(p_controller_id + 100, i, joy_axis);
|
||||
input->joy_axis(p_controller_id + 100, (JoyAxis)i, joy_axis);
|
||||
}
|
||||
free(axes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user