Commit 36b60b6f authored by jimtla's avatar jimtla

Fixed windo build errors. Should now be compilable.

parent 2ab139c2
......@@ -27,6 +27,8 @@
#include "SDL_events_c.h"
#include "../video/SDL_sysvideo.h"
#include <stdio.h>
static int SDL_num_touch = 0;
static SDL_Touch **SDL_touchPads = NULL;
......@@ -99,9 +101,7 @@ int
SDL_AddTouch(const SDL_Touch * touch, char *name)
{
SDL_Touch **touchPads;
int selected_touch;
int index;
size_t length;
int index,length;
if (SDL_GetTouchIndexId(touch->id) != -1) {
SDL_SetError("Touch ID already in use");
......@@ -252,7 +252,6 @@ SDL_AddFinger(SDL_Touch* touch,SDL_Finger* finger)
{
int index;
SDL_Finger **fingers;
size_t length;
//printf("Adding Finger...\n");
if (SDL_GetFingerIndexId(touch,finger->id) != -1) {
SDL_SetError("Finger ID already in use");
......@@ -260,15 +259,14 @@ SDL_AddFinger(SDL_Touch* touch,SDL_Finger* finger)
/* Add the touch to the list of touch */
if(touch->num_fingers >= touch->max_fingers){
printf("Making room for it!\n");
//printf("Making room for it!\n");
fingers = (SDL_Finger **) SDL_realloc(touch->fingers,
(touch->num_fingers + 1) * sizeof(SDL_Finger *));
touch->max_fingers = touch->num_fingers+1;
if (!fingers) {
SDL_OutOfMemory();
return -1;
}
else {
} else {
touch->max_fingers = touch->num_fingers+1;
touch->fingers = fingers;
}
......@@ -295,13 +293,14 @@ SDL_DelFinger(SDL_Touch* touch,int fingerid)
SDL_Finger* finger = SDL_GetFinger(touch,fingerid);
if (!finger) {
return;
return -1;
}
SDL_free(finger);
touch->num_fingers--;
touch->fingers[index] = touch->fingers[touch->num_fingers];
return 0;
}
......@@ -370,9 +369,10 @@ SDL_SendTouchMotion(int id, int fingerid, int relative,
return 0;
}
if(finger == NULL)
if(finger == NULL) {
SDL_SendFingerDown(id,fingerid,SDL_TRUE,x,y,pressure);
else {
return 0;
} else {
/* the relative motion is calculated regarding the last position */
if (relative) {
xrel = x;
......@@ -389,9 +389,9 @@ SDL_SendTouchMotion(int id, int fingerid, int relative,
/* Drop events that don't change state */
if (!xrel && !yrel) {
#if 0
#if 0
printf("Touch event didn't change state - dropped!\n");
#endif
#endif
return 0;
}
......@@ -483,7 +483,7 @@ SDL_SendTouchButton(int id, Uint8 state, Uint8 button)
if (SDL_GetEventState(type) == SDL_ENABLE) {
SDL_Event event;
event.type = type;
event.tbutton.touchId = (Uint8) index;
event.tbutton.touchId = (Uint8) touch->id;
event.tbutton.state = state;
event.tbutton.button = button;
event.tbutton.windowID = touch->focus ? touch->focus->id : 0;
......
......@@ -65,7 +65,7 @@ extern int SDL_SendTouchButton(int id, Uint8 state, Uint8 button);
extern void SDL_TouchQuit(void);
/* Get the index of a touch device */
extern int SDL_GetTouchIndexId(int id)
extern int SDL_GetTouchIndexId(int id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment