Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 28, 2005, 3:14:43 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: filled the flush function with more sense :) and rearanged some structures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/event/event_handler.cc

    r4363 r4364  
    198198}
    199199
    200 void EventHandler::flush()
    201 {
    202   for(int i = 0; i < ES_NUMBER; ++i)
     200void EventHandler::flush(elState state)
     201{
     202  if( state == ES_ALL)
     203    {
     204      for(int i = 0; i < ES_NUMBER; ++i)
     205        {
     206          for(int j = 0; j < SDLK_LAST; ++j)
     207            {
     208              this->listeners[i][j] = NULL;
     209            }
     210        }
     211    }
     212  else
    203213    {
    204214      for(int j = 0; j < SDLK_LAST; ++j)
    205215        {
    206           this->listeners[i][j] = NULL;
     216          this->listeners[state][j] = NULL;
    207217        }
    208218    }
     
    214224{
    215225  SDL_Event event;
    216   //Command cmd;
    217226  Event ev;
    218227  EventListener* listener;
     
    270279        }
    271280
     281      /* small debug routine: shows alle events dispatched by the event handler */
     282      PRINT(0)("\n==========================| EventHandler::Process () |===\n");
     283      PRINT(0)("=  Got Event nr%i\n, for state %i", event.type, this->state); 
     284      PRINT(0)("=======================================================\n");
     285     
    272286      listener = this->listeners[this->state][event.key.keysym.sym];
    273287      //if( listener != NULL)
Note: See TracChangeset for help on using the changeset viewer.