Removed carriage returns
authorSam Lantinga
Wed, 29 Dec 2010 15:23:54 -0800
changeset 49320d1bb1ce9d15
parent 4931 fc718f26c15e
child 4933 81a34196b980
Removed carriage returns
src/video/win32/SDL_win32events.c
     1.1 --- a/src/video/win32/SDL_win32events.c	Wed Dec 15 21:31:12 2010 -0500
     1.2 +++ b/src/video/win32/SDL_win32events.c	Wed Dec 29 15:23:54 2010 -0800
     1.3 @@ -56,9 +56,9 @@
     1.4  #ifndef WM_INPUT
     1.5  #define WM_INPUT 0x00ff
     1.6  #endif
     1.7 -#ifndef WM_TOUCH
     1.8 +#ifndef WM_TOUCH
     1.9  #define WM_TOUCH 0x0240
    1.10 -#endif
    1.11 +#endif
    1.12  
    1.13  
    1.14  static WPARAM
    1.15 @@ -520,11 +520,11 @@
    1.16          break;
    1.17  
    1.18  	case WM_TOUCH:
    1.19 -		{
    1.20 -			UINT i, num_inputs = LOWORD(wParam);
    1.21 -			PTOUCHINPUT inputs = SDL_stack_alloc(TOUCHINPUT, num_inputs);
    1.22 +		{
    1.23 +			UINT i, num_inputs = LOWORD(wParam);
    1.24 +			PTOUCHINPUT inputs = SDL_stack_alloc(TOUCHINPUT, num_inputs);
    1.25  			if (data->videodata->GetTouchInputInfo((HTOUCHINPUT)lParam, num_inputs, inputs, sizeof(TOUCHINPUT))) {
    1.26 -				RECT rect;
    1.27 +				RECT rect;
    1.28  				float x, y;
    1.29  
    1.30  				if (!GetClientRect(hwnd, &rect) ||
    1.31 @@ -532,14 +532,14 @@
    1.32  					break;
    1.33  				}
    1.34  				ClientToScreen(hwnd, (LPPOINT) & rect);
    1.35 -				ClientToScreen(hwnd, (LPPOINT) & rect + 1);
    1.36 -				rect.top *= 100;
    1.37 -				rect.left *= 100;
    1.38 -				rect.bottom *= 100;
    1.39 -				rect.right *= 100;
    1.40 -
    1.41 -				for (i = 0; i < num_inputs; ++i) {
    1.42 -					PTOUCHINPUT input = &inputs[i];
    1.43 +				ClientToScreen(hwnd, (LPPOINT) & rect + 1);
    1.44 +				rect.top *= 100;
    1.45 +				rect.left *= 100;
    1.46 +				rect.bottom *= 100;
    1.47 +				rect.right *= 100;
    1.48 +
    1.49 +				for (i = 0; i < num_inputs; ++i) {
    1.50 +					PTOUCHINPUT input = &inputs[i];
    1.51  
    1.52  					SDL_TouchID touchId = (SDL_TouchID)input->hSource;
    1.53  					if (!SDL_GetTouch(touchId)) {
    1.54 @@ -559,26 +559,26 @@
    1.55  						if (SDL_AddTouch(&touch, "") < 0) {
    1.56  							continue;
    1.57  						}
    1.58 -					}
    1.59 -
    1.60 -					// Get the normalized coordinates for the window
    1.61 -					x = (float)(input->x - rect.left)/(rect.right - rect.left);
    1.62 -					y = (float)(input->y - rect.top)/(rect.bottom - rect.top);
    1.63 -
    1.64 +					}
    1.65 +
    1.66 +					// Get the normalized coordinates for the window
    1.67 +					x = (float)(input->x - rect.left)/(rect.right - rect.left);
    1.68 +					y = (float)(input->y - rect.top)/(rect.bottom - rect.top);
    1.69 +
    1.70  					if (input->dwFlags & TOUCHEVENTF_DOWN) {
    1.71 -						SDL_SendFingerDown(touchId, input->dwID, SDL_TRUE, x, y, 1);
    1.72 -					}
    1.73 +						SDL_SendFingerDown(touchId, input->dwID, SDL_TRUE, x, y, 1);
    1.74 +					}
    1.75  					if (input->dwFlags & TOUCHEVENTF_MOVE) {
    1.76 -						SDL_SendTouchMotion(touchId, input->dwID, SDL_FALSE, x, y, 1);
    1.77 -					}
    1.78 +						SDL_SendTouchMotion(touchId, input->dwID, SDL_FALSE, x, y, 1);
    1.79 +					}
    1.80  					if (input->dwFlags & TOUCHEVENTF_UP) {
    1.81 -						SDL_SendFingerDown(touchId, input->dwID, SDL_FALSE, x, y, 1);
    1.82 -					}
    1.83 -				}
    1.84 -			}
    1.85 -			SDL_stack_free(inputs);
    1.86 -
    1.87 -			data->videodata->CloseTouchInputHandle((HTOUCHINPUT)lParam);
    1.88 +						SDL_SendFingerDown(touchId, input->dwID, SDL_FALSE, x, y, 1);
    1.89 +					}
    1.90 +				}
    1.91 +			}
    1.92 +			SDL_stack_free(inputs);
    1.93 +
    1.94 +			data->videodata->CloseTouchInputHandle((HTOUCHINPUT)lParam);
    1.95  			return 0;
    1.96  		}
    1.97  		break;