mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
mobile/ebitenmobileview: bug fix: compile error
This commit is contained in:
parent
2b902bacd9
commit
19bfc97a5e
@ -19,8 +19,6 @@ package gamepad
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/driver"
|
||||
)
|
||||
|
||||
type AndroidHatDirection int
|
||||
@ -42,7 +40,7 @@ func UpdateAndroidGamepadAxis(androidDeviceID int, axis int, value float64) {
|
||||
theGamepads.updateAndroidGamepadAxis(androidDeviceID, axis, value)
|
||||
}
|
||||
|
||||
func UpdateAndroidGamepadButton(androidDeviceID int, button driver.GamepadButton, pressed bool) {
|
||||
func UpdateAndroidGamepadButton(androidDeviceID int, button Button, pressed bool) {
|
||||
theGamepads.updateAndroidGamepadButton(androidDeviceID, button, pressed)
|
||||
}
|
||||
|
||||
@ -83,7 +81,7 @@ func (g *gamepads) updateAndroidGamepadAxis(androidDeviceID int, axis int, value
|
||||
gp.updateAndroidGamepadAxis(axis, value)
|
||||
}
|
||||
|
||||
func (g *gamepads) updateAndroidGamepadButton(androidDeviceID int, button driver.GamepadButton, pressed bool) {
|
||||
func (g *gamepads) updateAndroidGamepadButton(androidDeviceID int, button Button, pressed bool) {
|
||||
g.m.Lock()
|
||||
defer g.m.Unlock()
|
||||
|
||||
@ -119,7 +117,7 @@ func (g *Gamepad) updateAndroidGamepadAxis(axis int, value float64) {
|
||||
g.axes[axis] = value
|
||||
}
|
||||
|
||||
func (g *Gamepad) updateAndroidGamepadButton(button driver.GamepadButton, pressed bool) {
|
||||
func (g *Gamepad) updateAndroidGamepadButton(button Button, pressed bool) {
|
||||
g.m.Lock()
|
||||
defer g.m.Unlock()
|
||||
|
||||
|
@ -73,38 +73,38 @@ const (
|
||||
|
||||
// TODO: Can we map these values to the standard gamepad buttons?
|
||||
|
||||
var androidKeyToGamepadButton = map[int]driver.GamepadButton{
|
||||
keycodeButtonA: driver.GamepadButton0,
|
||||
keycodeButtonB: driver.GamepadButton1,
|
||||
keycodeButtonC: driver.GamepadButton2,
|
||||
keycodeButtonX: driver.GamepadButton3,
|
||||
keycodeButtonY: driver.GamepadButton4,
|
||||
keycodeButtonZ: driver.GamepadButton5,
|
||||
keycodeButtonL1: driver.GamepadButton6,
|
||||
keycodeButtonR1: driver.GamepadButton7,
|
||||
keycodeButtonL2: driver.GamepadButton8,
|
||||
keycodeButtonR2: driver.GamepadButton9,
|
||||
keycodeButtonThumbl: driver.GamepadButton10,
|
||||
keycodeButtonThumbr: driver.GamepadButton11,
|
||||
keycodeButtonStart: driver.GamepadButton12,
|
||||
keycodeButtonSelect: driver.GamepadButton13,
|
||||
keycodeButtonMode: driver.GamepadButton14,
|
||||
keycodeButton1: driver.GamepadButton15,
|
||||
keycodeButton2: driver.GamepadButton16,
|
||||
keycodeButton3: driver.GamepadButton17,
|
||||
keycodeButton4: driver.GamepadButton18,
|
||||
keycodeButton5: driver.GamepadButton19,
|
||||
keycodeButton6: driver.GamepadButton20,
|
||||
keycodeButton7: driver.GamepadButton21,
|
||||
keycodeButton8: driver.GamepadButton22,
|
||||
keycodeButton9: driver.GamepadButton23,
|
||||
keycodeButton10: driver.GamepadButton24,
|
||||
keycodeButton11: driver.GamepadButton25,
|
||||
keycodeButton12: driver.GamepadButton26,
|
||||
keycodeButton13: driver.GamepadButton27,
|
||||
keycodeButton14: driver.GamepadButton28,
|
||||
keycodeButton15: driver.GamepadButton29,
|
||||
keycodeButton16: driver.GamepadButton30,
|
||||
var androidKeyToGamepadButton = map[int]gamepad.Button{
|
||||
keycodeButtonA: gamepad.Button0,
|
||||
keycodeButtonB: gamepad.Button1,
|
||||
keycodeButtonC: gamepad.Button2,
|
||||
keycodeButtonX: gamepad.Button3,
|
||||
keycodeButtonY: gamepad.Button4,
|
||||
keycodeButtonZ: gamepad.Button5,
|
||||
keycodeButtonL1: gamepad.Button6,
|
||||
keycodeButtonR1: gamepad.Button7,
|
||||
keycodeButtonL2: gamepad.Button8,
|
||||
keycodeButtonR2: gamepad.Button9,
|
||||
keycodeButtonThumbl: gamepad.Button10,
|
||||
keycodeButtonThumbr: gamepad.Button11,
|
||||
keycodeButtonStart: gamepad.Button12,
|
||||
keycodeButtonSelect: gamepad.Button13,
|
||||
keycodeButtonMode: gamepad.Button14,
|
||||
keycodeButton1: gamepad.Button15,
|
||||
keycodeButton2: gamepad.Button16,
|
||||
keycodeButton3: gamepad.Button17,
|
||||
keycodeButton4: gamepad.Button18,
|
||||
keycodeButton5: gamepad.Button19,
|
||||
keycodeButton6: gamepad.Button20,
|
||||
keycodeButton7: gamepad.Button21,
|
||||
keycodeButton8: gamepad.Button22,
|
||||
keycodeButton9: gamepad.Button23,
|
||||
keycodeButton10: gamepad.Button24,
|
||||
keycodeButton11: gamepad.Button25,
|
||||
keycodeButton12: gamepad.Button26,
|
||||
keycodeButton13: gamepad.Button27,
|
||||
keycodeButton14: gamepad.Button28,
|
||||
keycodeButton15: gamepad.Button29,
|
||||
keycodeButton16: gamepad.Button30,
|
||||
}
|
||||
|
||||
// Axis constant definitions for joysticks only.
|
||||
|
Loading…
Reference in New Issue
Block a user