inpututil: revert inpututil changes

This reverts these commits:
* 0fd630100f
* 798b60b67c
* 5bb22d2bcf

Reason: this change is no longer needed.

Updates #2027
Updates #2039
This commit is contained in:
Hajime Hoshi 2022-04-01 02:06:26 +09:00
parent 07a7aca1b3
commit 03bf60cd92

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]++