mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/gamepaddb: refactoring
This commit is contained in:
parent
4a2c8212fb
commit
22715cd2d5
@ -410,13 +410,7 @@ func HasStandardAxis(id string, axis StandardAxis) bool {
|
|||||||
if mappings == nil {
|
if mappings == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
return mappings[axis] != nil
|
||||||
mapping := mappings[axis]
|
|
||||||
if mapping == nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func AxisValue(id string, axis StandardAxis, state GamepadState) float64 {
|
func AxisValue(id string, axis StandardAxis, state GamepadState) float64 {
|
||||||
@ -467,13 +461,7 @@ func HasStandardButton(id string, button StandardButton) bool {
|
|||||||
if mappings == nil {
|
if mappings == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
return mappings[button] != nil
|
||||||
mapping := mappings[button]
|
|
||||||
if mapping == nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func ButtonValue(id string, button StandardButton, state GamepadState) float64 {
|
func ButtonValue(id string, button StandardButton, state GamepadState) float64 {
|
||||||
|
Loading…
Reference in New Issue
Block a user