1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Revert "Web: Avoid unnecessary gamepad polling when no gamepads are connected"

This reverts commit 3e7e09f915.
This commit is contained in:
Adam Scott
2025-06-26 08:07:29 -04:00
parent 9a3976097f
commit 722accc5c8
3 changed files with 3 additions and 13 deletions

View File

@@ -205,7 +205,6 @@ const GodotInputGamepads = {
sample: function () {
const pads = GodotInputGamepads.get_pads();
const samples = [];
let active = 0;
for (let i = 0; i < pads.length; i++) {
const pad = pads[i];
if (!pad) {
@@ -225,10 +224,8 @@ const GodotInputGamepads = {
s.axes.push(pad.axes[a]);
}
samples.push(s);
active++;
}
GodotInputGamepads.samples = samples;
return active;
},
init: function (onchange) {
@@ -662,7 +659,8 @@ const GodotInput = {
godot_js_input_gamepad_sample__proxy: 'sync',
godot_js_input_gamepad_sample__sig: 'i',
godot_js_input_gamepad_sample: function () {
return GodotInputGamepads.sample();
GodotInputGamepads.sample();
return 0;
},
godot_js_input_gamepad_sample_get__proxy: 'sync',