Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Removed carriage returns
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Dec 29, 2010
1 parent 0200440 commit d6b6879
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions src/video/win32/SDL_win32events.c
Expand Up @@ -56,9 +56,9 @@
#ifndef WM_INPUT
#define WM_INPUT 0x00ff
#endif
#ifndef WM_TOUCH
#ifndef WM_TOUCH
#define WM_TOUCH 0x0240
#endif
#endif


static WPARAM
Expand Down Expand Up @@ -520,26 +520,26 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
break;

case WM_TOUCH:
{
UINT i, num_inputs = LOWORD(wParam);
PTOUCHINPUT inputs = SDL_stack_alloc(TOUCHINPUT, num_inputs);
{
UINT i, num_inputs = LOWORD(wParam);
PTOUCHINPUT inputs = SDL_stack_alloc(TOUCHINPUT, num_inputs);
if (data->videodata->GetTouchInputInfo((HTOUCHINPUT)lParam, num_inputs, inputs, sizeof(TOUCHINPUT))) {
RECT rect;
RECT rect;
float x, y;

if (!GetClientRect(hwnd, &rect) ||
(rect.right == rect.left && rect.bottom == rect.top)) {
break;
}
ClientToScreen(hwnd, (LPPOINT) & rect);
ClientToScreen(hwnd, (LPPOINT) & rect + 1);
rect.top *= 100;
rect.left *= 100;
rect.bottom *= 100;
rect.right *= 100;

for (i = 0; i < num_inputs; ++i) {
PTOUCHINPUT input = &inputs[i];
ClientToScreen(hwnd, (LPPOINT) & rect + 1);
rect.top *= 100;
rect.left *= 100;
rect.bottom *= 100;
rect.right *= 100;

for (i = 0; i < num_inputs; ++i) {
PTOUCHINPUT input = &inputs[i];

SDL_TouchID touchId = (SDL_TouchID)input->hSource;
if (!SDL_GetTouch(touchId)) {
Expand All @@ -559,26 +559,26 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (SDL_AddTouch(&touch, "") < 0) {
continue;
}
}

// Get the normalized coordinates for the window
x = (float)(input->x - rect.left)/(rect.right - rect.left);
y = (float)(input->y - rect.top)/(rect.bottom - rect.top);

}

// Get the normalized coordinates for the window
x = (float)(input->x - rect.left)/(rect.right - rect.left);
y = (float)(input->y - rect.top)/(rect.bottom - rect.top);

if (input->dwFlags & TOUCHEVENTF_DOWN) {
SDL_SendFingerDown(touchId, input->dwID, SDL_TRUE, x, y, 1);
}
SDL_SendFingerDown(touchId, input->dwID, SDL_TRUE, x, y, 1);
}
if (input->dwFlags & TOUCHEVENTF_MOVE) {
SDL_SendTouchMotion(touchId, input->dwID, SDL_FALSE, x, y, 1);
}
SDL_SendTouchMotion(touchId, input->dwID, SDL_FALSE, x, y, 1);
}
if (input->dwFlags & TOUCHEVENTF_UP) {
SDL_SendFingerDown(touchId, input->dwID, SDL_FALSE, x, y, 1);
}
}
}
SDL_stack_free(inputs);

data->videodata->CloseTouchInputHandle((HTOUCHINPUT)lParam);
SDL_SendFingerDown(touchId, input->dwID, SDL_FALSE, x, y, 1);
}
}
}
SDL_stack_free(inputs);

data->videodata->CloseTouchInputHandle((HTOUCHINPUT)lParam);
return 0;
}
break;
Expand Down

0 comments on commit d6b6879

Please sign in to comment.