You've already forked godot
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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user