mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-24 18:02:02 +01:00
mobile/ebitenmobileview: Refactoring: touches
This commit is contained in:
parent
5973833274
commit
d488fd7fcb
@ -76,11 +76,3 @@ func Update() error {
|
||||
|
||||
return update()
|
||||
}
|
||||
|
||||
func UpdateTouchesOnAndroid(action int, id int, x, y int) {
|
||||
updateTouchesOnAndroid(action, id, x, y)
|
||||
}
|
||||
|
||||
func UpdateTouchesOnIOS(phase int, ptr int64, x, y int) {
|
||||
updateTouchesOnIOSImpl(phase, ptr, x, y)
|
||||
}
|
||||
|
@ -21,11 +21,8 @@ func update() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func updateTouchesOnAndroid(action int, id int, x, y int) {
|
||||
func UpdateTouchesOnAndroid(action int, id int, x, y int) {
|
||||
}
|
||||
|
||||
func updateTouchesOnIOSImpl(phase int, ptr int64, x, y int) {
|
||||
}
|
||||
|
||||
func setUIView(uiview uintptr) {
|
||||
func UpdateTouchesOnIOS(phase int, ptr int64, x, y int) {
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
package ebitenmobileview
|
||||
|
||||
func updateTouchesOnAndroid(action int, id int, x, y int) {
|
||||
func UpdateTouchesOnAndroid(action int, id int, x, y int) {
|
||||
switch action {
|
||||
case 0x00, 0x05, 0x02: // ACTION_DOWN, ACTION_POINTER_DOWN, ACTION_MOVE
|
||||
touches[id] = position{x, y}
|
||||
@ -25,6 +25,6 @@ func updateTouchesOnAndroid(action int, id int, x, y int) {
|
||||
}
|
||||
}
|
||||
|
||||
func updateTouchesOnIOSImpl(phase int, ptr int64, x, y int) {
|
||||
func UpdateTouchesOnIOS(phase int, ptr int64, x, y int) {
|
||||
panic("ebitenmobileview: updateTouchesOnIOSImpl must not be called on Android")
|
||||
}
|
||||
|
@ -43,11 +43,11 @@ func getIDFromPtr(ptr int64) int {
|
||||
return id
|
||||
}
|
||||
|
||||
func updateTouchesOnAndroid(action int, id int, x, y int) {
|
||||
func UpdateTouchesOnAndroid(action int, id int, x, y int) {
|
||||
panic("ebitenmobileview: updateTouchesOnAndroid must not be called on iOS")
|
||||
}
|
||||
|
||||
func updateTouchesOnIOSImpl(phase int, ptr int64, x, y int) {
|
||||
func UpdateTouchesOnIOS(phase int, ptr int64, x, y int) {
|
||||
switch phase {
|
||||
case C.UITouchPhaseBegan, C.UITouchPhaseMoved, C.UITouchPhaseStationary:
|
||||
id := getIDFromPtr(ptr)
|
||||
|
Loading…
Reference in New Issue
Block a user