summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Becker <sylvain.becker@gmail.com>2019-04-02 17:57:27 +0200
committerSylvain Becker <sylvain.becker@gmail.com>2019-04-02 17:57:27 +0200
commit1cbf53b8393f64769ea45cec8117847717725343 (patch)
treebce934712a71934ca3b2cdcedebc443239e447e6
parent3dd804777381e91c600dcb1df9fc6e2aae45b8ae (diff)
Bug 4576: fix warning and compile
-rw-r--r--src/events/SDL_touch.c8
-rw-r--r--src/video/android/SDL_androidtouch.c1
-rw-r--r--src/video/emscripten/SDL_emscriptenevents.c1
-rw-r--r--src/video/windows/SDL_windowsevents.c2
4 files changed, 5 insertions, 7 deletions
diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c
index 839ea2e394..9c6bbfafd5 100644
--- a/src/events/SDL_touch.c
+++ b/src/events/SDL_touch.c
@@ -253,8 +253,8 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid,
if (window) {
if (down) {
if (finger_touching == SDL_FALSE) {
- int pos_x = x * window->w;
- int pos_y = y * window->y;
+ int pos_x = (int)(x * (float)window->w);
+ int pos_y = (int)(y * (float)window->y);
finger_touching = SDL_TRUE;
first_finger = fingerid;
SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y);
@@ -339,8 +339,8 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid,
SDL_Window *window = SDL_GetMouseFocus();
if (window) {
if (finger_touching == SDL_TRUE && first_finger == fingerid) {
- int pos_x = x * window->w;
- int pos_y = y * window->y;
+ int pos_x = (int)(x * (float)window->w);
+ int pos_y = (int)(y * (float)window->y);
SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y);
}
}
diff --git a/src/video/android/SDL_androidtouch.c b/src/video/android/SDL_androidtouch.c
index 5d508aa198..0e481001c7 100644
--- a/src/video/android/SDL_androidtouch.c
+++ b/src/video/android/SDL_androidtouch.c
@@ -68,7 +68,6 @@ void Android_OnTouch(SDL_Window *window, int touch_device_id_in, int pointer_fin
{
SDL_TouchID touchDeviceId = 0;
SDL_FingerID fingerId = 0;
- int window_x, window_y;
if (!window) {
return;
diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c
index 82fef9e5c4..ca13e107b0 100644
--- a/src/video/emscripten/SDL_emscriptenevents.c
+++ b/src/video/emscripten/SDL_emscriptenevents.c
@@ -431,7 +431,6 @@ Emscripten_HandleFocus(int eventType, const EmscriptenFocusEvent *wheelEvent, vo
static EM_BOOL
Emscripten_HandleTouch(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData)
{
- SDL_WindowData *window_data = userData;
int i;
double client_w, client_h;
int preventDefault = 0;
diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index 3141a8fcac..62dd94967e 100644
--- a/src/video/windows/SDL_windowsevents.c
+++ b/src/video/windows/SDL_windowsevents.c
@@ -528,7 +528,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
SDL_Mouse *mouse = SDL_GetMouse();
if (!mouse->relative_mode || mouse->relative_mode_warp) {
if ((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) != MOUSEEVENTF_FROMTOUCH) {
- WIN_CheckWParamMouseButtons(wParam, data, mouseID);
+ WIN_CheckWParamMouseButtons(wParam, data, 0);
}
}
}