Changeset 7868 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- May 26, 2006, 1:21:32 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/camera.cc
r7347 r7868 16 16 17 17 #include "camera.h" 18 19 #include "event_handler.h" 20 21 using namespace std; 22 18 #include "key_mapper.h" 23 19 24 20 /** … … 31 27 this->target = new CameraTarget(); 32 28 33 EventHandler::getInstance()->subscribe(this,ES_GAME, KeyMapper::PEV_VIEW0);34 EventHandler::getInstance()->subscribe(this,ES_GAME, KeyMapper::PEV_VIEW1);35 EventHandler::getInstance()->subscribe(this,ES_GAME, KeyMapper::PEV_VIEW2);36 EventHandler::getInstance()->subscribe(this,ES_GAME, KeyMapper::PEV_VIEW3);37 EventHandler::getInstance()->subscribe(this,ES_GAME, KeyMapper::PEV_VIEW4);38 EventHandler::getInstance()->subscribe(this,ES_GAME, KeyMapper::PEV_VIEW5);29 this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW0); 30 this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW1); 31 this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW2); 32 this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW3); 33 this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW4); 34 this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW5); 39 35 40 36 this->setFovy(90); -
trunk/src/world_entities/creatures/md2_creature.cc
r7337 r7868 32 32 #include "util/loading/factory.h" 33 33 #include "key_mapper.h" 34 #include "event_handler.h"35 34 36 35 #include "graphics_engine.h" -
trunk/src/world_entities/playable.cc
r7713 r7868 16 16 17 17 #include "playable.h" 18 #include "event_handler.h" 18 19 #include "key_mapper.h" 19 20 20 21 #include "player.h" … … 225 226 226 227 // unsubscibe all events. 227 EventHandler* evh = EventHandler::getInstance();228 228 std::vector<int>::iterator ev; 229 229 for (ev = this->events.begin(); ev != events.end(); ev++) 230 evh->unsubscribe(ES_GAME, (*ev));230 player->unsubscribeEvent(ES_GAME, (*ev)); 231 231 232 232 // leave the entity … … 251 251 252 252 /*EventHandler*/ 253 EventHandler* evh = EventHandler::getInstance();254 253 std::vector<int>::iterator ev; 255 254 for (ev = this->events.begin(); ev != events.end(); ev++) 256 evh->subscribe(player,ES_GAME, (*ev));255 player->subscribeEvent(ES_GAME, (*ev)); 257 256 258 257 this->enter(); … … 440 439 441 440 if (this->currentPlayer != NULL) 442 EventHandler::getInstance()->subscribe(this->currentPlayer,ES_GAME, eventType);441 this->currentPlayer->subscribeEvent(ES_GAME, eventType); 443 442 } 444 443 … … 453 452 454 453 if (this->currentPlayer != NULL) 455 EventHandler::getInstance()->unsubscribe(ES_GAME, eventType);454 this->currentPlayer->unsubscribeEvent(ES_GAME, eventType); 456 455 } 457 456 -
trunk/src/world_entities/player.cc
r7337 r7868 40 40 this->hud.show(); 41 41 42 EventHandler::getInstance()->subscribe(this,ES_GAME, KeyMapper::PEV_CHANGE_SHIP);42 this->subscribeEvent(ES_GAME, KeyMapper::PEV_CHANGE_SHIP); 43 43 } 44 44 -
trunk/src/world_entities/space_ships/helicopter.cc
r7810 r7868 28 28 29 29 #include "key_mapper.h" 30 #include "event_handler.h"31 30 #include "state.h" 32 31 -
trunk/src/world_entities/space_ships/hover.cc
r7337 r7868 26 26 #include "util/loading/factory.h" 27 27 #include "key_mapper.h" 28 #include "event_handler.h"29 28 #include "state.h" 30 29 -
trunk/src/world_entities/space_ships/space_ship.cc
r7346 r7868 31 31 #include "util/loading/factory.h" 32 32 #include "key_mapper.h" 33 #include "event_handler.h"34 33 35 34 #include "network_game_manager.h" -
trunk/src/world_entities/space_ships/turbine_hover.cc
r7348 r7868 26 26 #include "util/loading/factory.h" 27 27 #include "key_mapper.h" 28 #include "event_handler.h"29 28 #include "state.h" 30 29 … … 32 31 #include "dot_emitter.h" 33 32 #include "sprite_particles.h" 34 35 using namespace std;36 33 37 34 CREATE_FACTORY(TurbineHover, CL_TURBINE_HOVER); … … 176 173 177 174 178 //add events to the eventlist 179 registerEvent(KeyMapper::PEV_FORWARD);180 registerEvent(KeyMapper::PEV_BACKWARD);181 registerEvent(KeyMapper::PEV_LEFT);182 registerEvent(KeyMapper::PEV_RIGHT);183 registerEvent(KeyMapper::PEV_UP);184 registerEvent(KeyMapper::PEV_DOWN);185 registerEvent(KeyMapper::PEV_FIRE1);186 registerEvent(KeyMapper::PEV_NEXT_WEAPON);187 registerEvent(KeyMapper::PEV_PREVIOUS_WEAPON);188 registerEvent(EV_MOUSE_MOTION);175 //add events to the eventlist of the Playable 176 this->registerEvent(KeyMapper::PEV_FORWARD); 177 this->registerEvent(KeyMapper::PEV_BACKWARD); 178 this->registerEvent(KeyMapper::PEV_LEFT); 179 this->registerEvent(KeyMapper::PEV_RIGHT); 180 this->registerEvent(KeyMapper::PEV_UP); 181 this->registerEvent(KeyMapper::PEV_DOWN); 182 this->registerEvent(KeyMapper::PEV_FIRE1); 183 this->registerEvent(KeyMapper::PEV_NEXT_WEAPON); 184 this->registerEvent(KeyMapper::PEV_PREVIOUS_WEAPON); 185 this->registerEvent(EV_MOUSE_MOTION); 189 186 190 187 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); -
trunk/src/world_entities/weapons/crosshair.cc
r7221 r7868 17 17 18 18 #include "crosshair.h" 19 #include "event_handler.h"20 19 21 20 #include "util/loading/load_param.h" … … 65 64 this->material = new Material; 66 65 67 // EventHandler::getInstance()->subscribe(this,ES_GAME, EV_MOUSE_MOTION);66 //this->subscribeEvent(ES_GAME, EV_MOUSE_MOTION); 68 67 69 68 // center the mouse on the screen, and also hide the cursors
Note: See TracChangeset
for help on using the changeset viewer.