Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4405 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
May 30, 2005, 6:36:43 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: event_handler subscribe functionality improved

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/story_entities/world.cc

    r4397 r4405  
    6262
    6363#include "projectile.h"
     64#include "event_handler.h"
    6465
    6566using namespace std;
     
    418419  Orxonox *orx = Orxonox::getInstance ();
    419420  orx->getLocalInput()->bind (localPlayer);
     421
     422  EventHandler::getInstance()->subscribe(this->localPlayer, ES_ALL, KeyMapper::PEV_UP);
    420423 
    421424  // bind camera
  • orxonox/trunk/src/util/event/event_handler.cc

    r4398 r4405  
    8080}
    8181
    82 void EventHandler::subscribeListener(EventListener* el, elState state, int eventType)
     82void EventHandler::subscribe(EventListener* el, elState state, int eventType)
    8383{
    8484  if( likely(this->listeners[state][eventType] == NULL))
     
    8989
    9090
    91 void EventHandler::unsubscribeListener(int eventType, elState state)
     91void EventHandler::unsubscribe(int eventType, elState state)
    9292{
    9393  this->listeners[state][eventType] = NULL;
  • orxonox/trunk/src/util/event/event_handler.h

    r4388 r4405  
    99
    1010#include "base_object.h"
     11#include "key_mapper.h"
    1112#include "event_def.h"
    1213
     
    2324  void setState(elState state);
    2425
    25   void subscribeListener(EventListener* el, elState state, int eventType);
    26   void unsubscribeListener(int eventType, elState state);
     26  void subscribe(EventListener* el, elState state, int eventType);
     27  void unsubscribe(int eventType, elState state);
    2728  void flush(elState state);
    2829
  • orxonox/trunk/src/util/event/key_mapper.h

    r4403 r4405  
    1414
    1515
    16 //! Key aliasing structure
    17 /**
    18    This structure contains the key aliasing information, e.g. the command strings that
    19    have been bound to the keys.
    20 */
    21 typedef struct
    22 {
    23   char keys[N_STD_KEYS][CMD_LENGHT];
    24   char buttons[N_BUTTONS][CMD_LENGHT];
    25 } KeyBindings;
     16
    2617
    2718typedef struct orxKeyMapping
  • orxonox/trunk/src/world_entities/player.cc

    r4404 r4405  
    203203void Player::tick (float time)
    204204{
    205   printf("%p\n", this);
    206   this->getRelCoor().debug();
     205  //printf("%p\n", this);
     206  //this->getRelCoor().debug();
    207207 
    208208  /* link tick to weapon */
Note: See TracChangeset for help on using the changeset viewer.