inpututil: revert commits

This reverts these commits:
 * 700d478665
 * e583d28a82
 * 4749fc4193

Reason: This fix is not needed for 2.2. See #2039
This commit is contained in:
Hajime Hoshi 2022-03-30 12:17:08 +09:00
parent 700d478665
commit 6f87e49bb8

View File

@ -137,10 +137,10 @@ func (i *inputState) update() {
for _, id := range i.gamepadIDsBuf {
i.gamepadIDs[id] = struct{}{}
n := ebiten.GamepadButtonNum(id)
if n != len(i.gamepadButtonDurations[id]) {
i.gamepadButtonDurations[id] = make([]int, n)
if _, ok := i.gamepadButtonDurations[id]; !ok {
i.gamepadButtonDurations[id] = make([]int, ebiten.GamepadButtonMax+1)
}
n := ebiten.GamepadButtonNum(id)
for b := ebiten.GamepadButton(0); b < ebiten.GamepadButton(n); b++ {
if ebiten.IsGamepadButtonPressed(id, b) {
i.gamepadButtonDurations[id][b]++