mirror of https://github.com/encounter/SDL.git
Bug 4576: fix warning and compile
This commit is contained in:
parent
9b3c2258aa
commit
b45abbb2a7
|
@ -253,8 +253,8 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid,
|
||||||
if (window) {
|
if (window) {
|
||||||
if (down) {
|
if (down) {
|
||||||
if (finger_touching == SDL_FALSE) {
|
if (finger_touching == SDL_FALSE) {
|
||||||
int pos_x = x * window->w;
|
int pos_x = (int)(x * (float)window->w);
|
||||||
int pos_y = y * window->y;
|
int pos_y = (int)(y * (float)window->y);
|
||||||
finger_touching = SDL_TRUE;
|
finger_touching = SDL_TRUE;
|
||||||
first_finger = fingerid;
|
first_finger = fingerid;
|
||||||
SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y);
|
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();
|
SDL_Window *window = SDL_GetMouseFocus();
|
||||||
if (window) {
|
if (window) {
|
||||||
if (finger_touching == SDL_TRUE && first_finger == fingerid) {
|
if (finger_touching == SDL_TRUE && first_finger == fingerid) {
|
||||||
int pos_x = x * window->w;
|
int pos_x = (int)(x * (float)window->w);
|
||||||
int pos_y = y * window->y;
|
int pos_y = (int)(y * (float)window->y);
|
||||||
SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y);
|
SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,6 @@ void Android_OnTouch(SDL_Window *window, int touch_device_id_in, int pointer_fin
|
||||||
{
|
{
|
||||||
SDL_TouchID touchDeviceId = 0;
|
SDL_TouchID touchDeviceId = 0;
|
||||||
SDL_FingerID fingerId = 0;
|
SDL_FingerID fingerId = 0;
|
||||||
int window_x, window_y;
|
|
||||||
|
|
||||||
if (!window) {
|
if (!window) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -431,7 +431,6 @@ Emscripten_HandleFocus(int eventType, const EmscriptenFocusEvent *wheelEvent, vo
|
||||||
static EM_BOOL
|
static EM_BOOL
|
||||||
Emscripten_HandleTouch(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData)
|
Emscripten_HandleTouch(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData)
|
||||||
{
|
{
|
||||||
SDL_WindowData *window_data = userData;
|
|
||||||
int i;
|
int i;
|
||||||
double client_w, client_h;
|
double client_w, client_h;
|
||||||
int preventDefault = 0;
|
int preventDefault = 0;
|
||||||
|
|
|
@ -528,7 +528,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
SDL_Mouse *mouse = SDL_GetMouse();
|
SDL_Mouse *mouse = SDL_GetMouse();
|
||||||
if (!mouse->relative_mode || mouse->relative_mode_warp) {
|
if (!mouse->relative_mode || mouse->relative_mode_warp) {
|
||||||
if ((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) != MOUSEEVENTF_FROMTOUCH) {
|
if ((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) != MOUSEEVENTF_FROMTOUCH) {
|
||||||
WIN_CheckWParamMouseButtons(wParam, data, mouseID);
|
WIN_CheckWParamMouseButtons(wParam, data, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue