mirror of
https://github.com/love2d/megasource.git
synced 2026-08-18 19:54:37 +02:00
Upgrade to SDL2.0.2 (8393682d9d96d1516831a397290cb34ceb82129f).
This commit is contained in:
@@ -503,17 +503,28 @@ SDL_GetEventFilter(SDL_EventFilter * filter, void **userdata)
|
||||
void
|
||||
SDL_AddEventWatch(SDL_EventFilter filter, void *userdata)
|
||||
{
|
||||
SDL_EventWatcher *watcher;
|
||||
SDL_EventWatcher *watcher, *tail;
|
||||
|
||||
watcher = (SDL_EventWatcher *)SDL_malloc(sizeof(*watcher));
|
||||
if (!watcher) {
|
||||
/* Uh oh... */
|
||||
return;
|
||||
}
|
||||
|
||||
/* create the watcher */
|
||||
watcher->callback = filter;
|
||||
watcher->userdata = userdata;
|
||||
watcher->next = SDL_event_watchers;
|
||||
SDL_event_watchers = watcher;
|
||||
watcher->next = NULL;
|
||||
|
||||
/* add the watcher to the end of the list */
|
||||
if (SDL_event_watchers) {
|
||||
for (tail = SDL_event_watchers; tail->next; tail = tail->next) {
|
||||
continue;
|
||||
}
|
||||
tail->next = watcher;
|
||||
} else {
|
||||
SDL_event_watchers = watcher;
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: This is not thread-safe yet */
|
||||
|
||||
@@ -418,13 +418,8 @@ int SDL_GestureAddTouch(SDL_TouchID touchId)
|
||||
|
||||
SDL_gestureTouch = gestureTouch;
|
||||
|
||||
SDL_gestureTouch[SDL_numGestureTouches].numDownFingers = 0;
|
||||
SDL_zero(SDL_gestureTouch[SDL_numGestureTouches]);
|
||||
SDL_gestureTouch[SDL_numGestureTouches].id = touchId;
|
||||
|
||||
SDL_gestureTouch[SDL_numGestureTouches].numDollarTemplates = 0;
|
||||
|
||||
SDL_gestureTouch[SDL_numGestureTouches].recording = SDL_FALSE;
|
||||
|
||||
SDL_numGestureTouches++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -538,7 +538,10 @@ SDL_SetRelativeMouseMode(SDL_bool enabled)
|
||||
} else if (enabled && ShouldUseRelativeModeWarp(mouse)) {
|
||||
mouse->relative_mode_warp = SDL_TRUE;
|
||||
} else if (mouse->SetRelativeMouseMode(enabled) < 0) {
|
||||
return -1;
|
||||
if (enabled) {
|
||||
// Fall back to warp mode if native relative mode failed
|
||||
mouse->relative_mode_warp = SDL_TRUE;
|
||||
}
|
||||
}
|
||||
mouse->relative_mode = enabled;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user