src/events/SDL_events.c
branchSDL-1.3
changeset 1731 875c3cf1a12c
parent 1724 6c63fc2bd986
     1.1 --- a/src/events/SDL_events.c	Sat Jul 08 18:06:02 2006 +0000
     1.2 +++ b/src/events/SDL_events.c	Sat Jul 08 20:07:08 2006 +0000
     1.3 @@ -435,9 +435,13 @@
     1.4  int
     1.5  SDL_PushEvent(SDL_Event * event)
     1.6  {
     1.7 -    if (SDL_PeepEvents(event, 1, SDL_ADDEVENT, 0) <= 0)
     1.8 +    if (SDL_EventOK && !SDL_EventOK(SDL_EventOKParam, event)) {
     1.9 +        return 0;
    1.10 +    }
    1.11 +    if (SDL_PeepEvents(event, 1, SDL_ADDEVENT, 0) <= 0) {
    1.12          return -1;
    1.13 -    return 0;
    1.14 +    }
    1.15 +    return 1;
    1.16  }
    1.17  
    1.18  void
    1.19 @@ -451,13 +455,16 @@
    1.20      while (SDL_PollEvent(&bitbucket) > 0);
    1.21  }
    1.22  
    1.23 -SDL_EventFilter
    1.24 -SDL_GetEventFilter(void **userdata)
    1.25 +SDL_bool
    1.26 +SDL_GetEventFilter(SDL_EventFilter * filter, void **userdata)
    1.27  {
    1.28 +    if (filter) {
    1.29 +        *filter = SDL_EventOK;
    1.30 +    }
    1.31      if (userdata) {
    1.32          *userdata = SDL_EventOKParam;
    1.33      }
    1.34 -    return (SDL_EventOK);
    1.35 +    return SDL_EventOK ? SDL_TRUE : SDL_FALSE;
    1.36  }
    1.37  
    1.38  void
    1.39 @@ -536,11 +543,7 @@
    1.40          SDL_memset(&event, 0, sizeof(event));
    1.41          event.type = SDL_SYSWMEVENT;
    1.42          event.syswm.msg = message;
    1.43 -        if ((SDL_EventOK == NULL)
    1.44 -            || (*SDL_EventOK) (SDL_EventOKParam, &event)) {
    1.45 -            posted = 1;
    1.46 -            SDL_PushEvent(&event);
    1.47 -        }
    1.48 +        posted = (SDL_PushEvent(&event) > 0);
    1.49      }
    1.50      /* Update internal event state */
    1.51      return (posted);