Changeset 4420 in orxonox.OLD for orxonox/trunk/src/util/event
- Timestamp:
- May 31, 2005, 5:27:49 PM (20 years ago)
- Location:
- orxonox/trunk/src/util/event
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/event/event_handler.cc
r4419 r4420 127 127 for(int i = 0; i < ES_NUMBER; ++i) 128 128 { 129 for(int j = 0; j < SDLK_LAST; ++j)129 for(int j = 0; j < EV_NUMBER; ++j) 130 130 { 131 131 this->listeners[i][j] = NULL; … … 135 135 else 136 136 { 137 for(int j = 0; j < SDLK_LAST; ++j)137 for(int j = 0; j < EV_NUMBER; ++j) 138 138 { 139 139 this->listeners[state][j] = NULL; 140 } 141 } 142 } 143 144 void EventHandler::unsubscribe(EventListener* el, elState state) 145 { 146 if( state == ES_ALL) 147 { 148 for(int i = 0; i < ES_NUMBER; ++i) 149 { 150 for(int j = 0; j < EV_NUMBER; ++j) 151 { 152 if( this->listeners[i][j] == el ) 153 this->listeners[i][j] = NULL; 154 } 155 } 156 } 157 else 158 { 159 for(int j = 0; j < EV_NUMBER; ++j) 160 { 161 if( this->listeners[state][j] == el ) 162 this->listeners[state][j] = NULL; 140 163 } 141 164 } -
orxonox/trunk/src/util/event/event_handler.h
r4419 r4420 28 28 void subscribe(EventListener* el, elState state, int eventType); 29 29 void unsubscribe(elState state, int eventType); 30 void unsubscribe(EventListener* el, elState state = ES_ALL); 31 30 32 void flush(elState state); 31 33
Note: See TracChangeset
for help on using the changeset viewer.