- Timestamp:
- May 31, 2005, 5:27:49 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/story_entities/world.cc
r4419 r4420 171 171 { 172 172 PRINTF(3)("World::~World() - deleting current world\n"); 173 CommandNode* cn = Orxonox::getInstance()->getLocalInput(); 174 cn->unbind(this->localPlayer); 175 cn->reset(); 173 174 this->eventHandler->unsubscribe(this->localPlayer); 176 175 177 176 delete WorldInterface::getInstance(); … … 186 185 //delete garbagecollecor 187 186 //delete animator 188 189 this->eventHandler->unsubscribe(ES_GAME, KeyMapper::PEV_UP);190 this->eventHandler->unsubscribe(ES_GAME, KeyMapper::PEV_DOWN);191 this->eventHandler->unsubscribe(ES_GAME, KeyMapper::PEV_LEFT);192 this->eventHandler->unsubscribe(ES_GAME, KeyMapper::PEV_RIGHT);193 this->eventHandler->unsubscribe(ES_GAME, KeyMapper::PEV_FIRE1);194 this->eventHandler->unsubscribe(ES_GAME, KeyMapper::PEV_NEXT_WEAPON);195 this->eventHandler->unsubscribe(ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON);196 197 187 198 188 LoadClassDescription::printAll(); -
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 -
orxonox/trunk/src/world_entities/camera.cc
r4419 r4420 57 57 Camera::~Camera(void) 58 58 { 59 EventHandler::getInstance()->unsubscribe(ES_GAME, KeyMapper::PEV_VIEW0); 60 EventHandler::getInstance()->unsubscribe(ES_GAME, KeyMapper::PEV_VIEW1); 61 EventHandler::getInstance()->unsubscribe(ES_GAME, KeyMapper::PEV_VIEW2); 62 EventHandler::getInstance()->unsubscribe(ES_GAME, KeyMapper::PEV_VIEW3); 63 EventHandler::getInstance()->unsubscribe(ES_GAME, KeyMapper::PEV_VIEW4); 64 EventHandler::getInstance()->unsubscribe(ES_GAME, KeyMapper::PEV_VIEW5); 59 EventHandler::getInstance()->unsubscribe(this); 65 60 } 66 61
Note: See TracChangeset
for help on using the changeset viewer.