mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
internal/goglfw: fix _GET_X_LPARAM and _GET_Y_LPARAM from api_windows.go (#2665)
Negative values should not disappear. For example, if _HIWORD returns 63000, then _GET_Y_LPARAM should return -2536, but now it returns 63000. This fixes that.
This commit is contained in:
parent
50b68a0427
commit
12a179aab9
@ -367,7 +367,7 @@ type (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func _GET_X_LPARAM(lp _LPARAM) int {
|
func _GET_X_LPARAM(lp _LPARAM) int {
|
||||||
return int(_LOWORD(uint32(lp)))
|
return int(int16(_LOWORD(uint32(lp))))
|
||||||
}
|
}
|
||||||
|
|
||||||
func _GET_XBUTTON_WPARAM(wParam _WPARAM) uint16 {
|
func _GET_XBUTTON_WPARAM(wParam _WPARAM) uint16 {
|
||||||
@ -375,7 +375,7 @@ func _GET_XBUTTON_WPARAM(wParam _WPARAM) uint16 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func _GET_Y_LPARAM(lp _LPARAM) int {
|
func _GET_Y_LPARAM(lp _LPARAM) int {
|
||||||
return int(_HIWORD(uint32(lp)))
|
return int(int16(_HIWORD(uint32(lp))))
|
||||||
}
|
}
|
||||||
|
|
||||||
func _HIWORD(dwValue uint32) uint16 {
|
func _HIWORD(dwValue uint32) uint16 {
|
||||||
|
Loading…
Reference in New Issue
Block a user