mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
internal/gamepad: refactoring
This commit is contained in:
parent
c74e7fa943
commit
c7eb7371f4
@ -40,35 +40,20 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func currentPlatform() platform {
|
func currentPlatform() platform {
|
||||||
if runtime.GOOS == "windows" {
|
switch runtime.GOOS {
|
||||||
|
case "windows":
|
||||||
return platformWindows
|
return platformWindows
|
||||||
}
|
case "aix", "dragonfly", "freebsd", "hurd", "illumos", "linux", "netbsd", "openbsd", "solaris":
|
||||||
|
|
||||||
if runtime.GOOS == "aix" ||
|
|
||||||
runtime.GOOS == "dragonfly" ||
|
|
||||||
runtime.GOOS == "freebsd" ||
|
|
||||||
runtime.GOOS == "hurd" ||
|
|
||||||
runtime.GOOS == "illumos" ||
|
|
||||||
runtime.GOOS == "linux" ||
|
|
||||||
runtime.GOOS == "netbsd" ||
|
|
||||||
runtime.GOOS == "openbsd" ||
|
|
||||||
runtime.GOOS == "solaris" {
|
|
||||||
return platformUnix
|
return platformUnix
|
||||||
}
|
case "android":
|
||||||
|
|
||||||
if runtime.GOOS == "android" {
|
|
||||||
return platformAndroid
|
return platformAndroid
|
||||||
}
|
case "ios":
|
||||||
|
|
||||||
if runtime.GOOS == "ios" {
|
|
||||||
return platformIOS
|
return platformIOS
|
||||||
}
|
case "darwin":
|
||||||
|
|
||||||
if runtime.GOOS == "darwin" {
|
|
||||||
return platformMacOS
|
return platformMacOS
|
||||||
}
|
default:
|
||||||
|
|
||||||
return platformUnknown
|
return platformUnknown
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type mappingType int
|
type mappingType int
|
||||||
|
Loading…
Reference in New Issue
Block a user