Ticket #4408: fixAtlas.patch

File fixAtlas.patch, 1.9 KB (added by wraitii, 7 years ago)
  • source/lib/input.cpp

    diff --git a/source/lib/input.cpp b/source/lib/input.cpp
    index 6f7b4d1..e5b4593 100644
    a b void in_push_priority_event(const SDL_Event_* event)  
    7777    priority_events.push_back(*event);
    7878}
    7979
    80 int in_poll_event(SDL_Event_* event)
     80int in_poll_priority_event(SDL_Event_* event)
    8181{
    8282    if (!priority_events.empty())
    8383    {
    int in_poll_event(SDL_Event_* event)  
    8585        priority_events.pop_front();
    8686        return 1;
    8787    }
     88    return 0;
     89}
    8890
    89     return SDL_PollEvent(&event->ev);
     91int in_poll_event(SDL_Event_* event)
     92{
     93    return in_poll_priority_event(event) ? 1 : SDL_PollEvent(&event->ev);
    9094}
  • source/lib/input.h

    diff --git a/source/lib/input.h b/source/lib/input.h
    index 851e638..9be8ffe 100644
    a b extern void in_dispatch_event(const SDL_Event_* event);  
    5959// be returned by in_poll_event before any standard SDL events
    6060extern void in_push_priority_event(const SDL_Event_* event);
    6161
    62 // reads events that were pushed by in_push_priority_event, or (if there are
     62// reads events that were pushed by in_push_priority_event
     63// returns 1 if an event was read, 0 otherwise.
     64extern int in_poll_priority_event(SDL_Event_* event);
     65
     66// reads events that were pushed by in_push_priority_event, or, if there are
    6367// no high-priority events) reads from the SDL event queue with SDL_PollEvent.
    6468// returns 1 if an event was read, 0 otherwise.
    6569extern int in_poll_event(SDL_Event_* event);
  • source/tools/atlas/GameInterface/GameLoop.cpp

    diff --git a/source/tools/atlas/GameInterface/GameLoop.cpp b/source/tools/atlas/GameInterface/GameLoop.cpp
    index 44c575e..98912cd 100644
    a b static void* RunEngine(void* data)  
    218218
    219219        // Pump SDL events (e.g. hotkeys)
    220220        SDL_Event_ ev;
    221         while (in_poll_event(&ev))
     221        while (in_poll_priority_event(&ev))
    222222            in_dispatch_event(&ev);
    223223
    224224        if (g_GUI)