Browse Source

Merge pull request #25149 from eska014/html5-gamepad-sampling

Fix HTML5 gamepad sampling
Rémi Verschelde 6 năm trước cách đây
mục cha
commit
35728e41ba
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      platform/javascript/os_javascript.cpp

+ 2 - 1
platform/javascript/os_javascript.cpp

@@ -970,7 +970,8 @@ bool OS_JavaScript::main_loop_iterate() {
 		}
 	}
 
-	process_joypads();
+	if (emscripten_sample_gamepad_data() == EMSCRIPTEN_RESULT_SUCCESS)
+		process_joypads();
 
 	if (just_exited_fullscreen) {
 		if (window_maximized) {