Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4452 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Jun 1, 2005, 11:18:44 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: key_mapper.* commented and reviewed

Location:
orxonox/trunk/src/util/event
Files:
4 edited

Legend:

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

    r4346 r4452  
    2323/**
    2424   \brief standard constructor
    25    \todo this constructor is not jet implemented - do it
    2625*/
    2726EventListener::EventListener ()
     
    3635*/
    3736EventListener::~EventListener ()
    38 {
    39   // delete what has to be deleted here
    40 }
     37{}
  • orxonox/trunk/src/util/event/event_listener.h

    r4404 r4452  
    2121
    2222  virtual void process(const Event &event) = NULL;
    23 
    24  private:
    25  
    26 
    2723};
    2824
  • orxonox/trunk/src/util/event/key_mapper.cc

    r4412 r4452  
    2727
    2828
    29 
    30 int KeyMapper::PEV_UP = -1;
    31 int KeyMapper::PEV_DOWN = -1;
    32 int KeyMapper::PEV_LEFT = -1;
    33 int KeyMapper::PEV_RIGHT = -1;
    34 int KeyMapper::PEV_STRAFE_LEFT = -1;
    35 int KeyMapper::PEV_STRAFE_RIGHT = -1;
    36 
    37 int KeyMapper::PEV_FIRE1 = -1;
    38 int KeyMapper::PEV_FIRE2 = -1;
    39 int KeyMapper::PEV_PREVIOUS_WEAPON = -1;
    40 int KeyMapper::PEV_NEXT_WEAPON = -1;
    41 
    42 int KeyMapper::PEV_VIEW0 = -1;
    43 int KeyMapper::PEV_VIEW1 = -1;
    44 int KeyMapper::PEV_VIEW2 = -1;
    45 int KeyMapper::PEV_VIEW3 = -1;
    46 int KeyMapper::PEV_VIEW4 = -1;
    47 int KeyMapper::PEV_VIEW5 = -1;
    48 
    49 int KeyMapper::PEV_NEXT_WORLD = -1;
    50 int KeyMapper::PEV_PREVIOUS_WORLD = -1;
    51 
    52 int KeyMapper::PEV_PAUSE = -1;
    53 int KeyMapper::PEV_QUIT = -1;
    54 
    55 
    56 
    57 
     29/* initialize all variables to a reasonable value*/
     30int KeyMapper::PEV_UP                = EV_UNKNOWN;
     31int KeyMapper::PEV_DOWN              = EV_UNKNOWN;
     32int KeyMapper::PEV_LEFT              = EV_UNKNOWN;
     33int KeyMapper::PEV_RIGHT             = EV_UNKNOWN;
     34int KeyMapper::PEV_STRAFE_LEFT       = EV_UNKNOWN;
     35int KeyMapper::PEV_STRAFE_RIGHT      = EV_UNKNOWN;
     36
     37int KeyMapper::PEV_FIRE1             = EV_UNKNOWN;
     38int KeyMapper::PEV_FIRE2             = EV_UNKNOWN;
     39int KeyMapper::PEV_PREVIOUS_WEAPON   = EV_UNKNOWN;
     40int KeyMapper::PEV_NEXT_WEAPON       = EV_UNKNOWN;
     41
     42int KeyMapper::PEV_VIEW0             = EV_UNKNOWN;
     43int KeyMapper::PEV_VIEW1             = EV_UNKNOWN;
     44int KeyMapper::PEV_VIEW2             = EV_UNKNOWN;
     45int KeyMapper::PEV_VIEW3             = EV_UNKNOWN;
     46int KeyMapper::PEV_VIEW4             = EV_UNKNOWN;
     47int KeyMapper::PEV_VIEW5             = EV_UNKNOWN;
     48
     49int KeyMapper::PEV_NEXT_WORLD        = EV_UNKNOWN;
     50int KeyMapper::PEV_PREVIOUS_WORLD    = EV_UNKNOWN;
     51
     52int KeyMapper::PEV_PAUSE             = EV_UNKNOWN;
     53int KeyMapper::PEV_QUIT              = EV_UNKNOWN;
     54
     55
     56
     57//! this is the mapping array from names to ids: enter all orxonox.conf keys here
    5858orxKeyMapping map[] = { {&KeyMapper::PEV_UP, "Up"},
    5959                        {&KeyMapper::PEV_DOWN, "Down"},
     
    8585
    8686
     87
    8788/**
    8889   \brief standard constructor
    89    \todo this constructor is not jet implemented - do it
    9090*/
    9191KeyMapper::KeyMapper ()
     
    9797/**
    9898   \brief standard deconstructor
    99 
    10099*/
    101100KeyMapper::~KeyMapper ()
    102101{
    103   // delete what has to be deleted here
    104 }
    105 
    106 \
     102}
     103
     104
     105
    107106/**
    108107   \brief loads new key bindings from a file
     
    185184
    186185
    187 
     186/**
     187   \brief this function looks up name to key index
     188   \param the name of the button
     189*/
    188190int* KeyMapper::nameToIndex (char* name)
    189191{
     
    205207
    206208
    207 
     209/**
     210   \brief the function maps name to key ids
     211   \param name of the key
     212   \param id of the key
     213*/
    208214void KeyMapper::mapKeys(char* name, int keyID)
    209215{
     
    216222
    217223
     224/**
     225   \brief this function gives some debug information about the key mapper class
     226*/
    218227void KeyMapper::debug()
    219228{
    220   //PRINT(0)("\n==========================| KeyMapper::debug() |===\n"); 
    221 
     229  PRINT(0)("\n==========================| KeyMapper::debug() |===\n"); 
    222230  for(int i = 0; map[i].pValue != NULL; ++i)
    223231    {
    224232      PRINT(0)("%s = %i\n",map[i].pName, *map[i].pValue);
    225233    }
    226 
    227   //PRINT(0)("=======================================================\n");       
    228 }
     234  PRINT(0)("=======================================================\n");       
     235}
  • orxonox/trunk/src/util/event/key_mapper.h

    r4412 r4452  
    1313
    1414
    15 
    16 
    17 
     15//! A mapping from key-name to key-id
    1816typedef struct orxKeyMapping
    1917{
     
    3937
    4038 public:
    41   static int PEV_UP;
    42   static int PEV_DOWN;
    43   static int PEV_LEFT;
    44   static int PEV_RIGHT;
     39  static int PEV_UP;                //!< up button
     40  static int PEV_DOWN;              //!< down buttton
     41  static int PEV_LEFT;              //!< left button
     42  static int PEV_RIGHT;             //!< right button
    4543 
    46   static int PEV_STRAFE_LEFT;
    47   static int PEV_STRAFE_RIGHT;
     44  static int PEV_STRAFE_LEFT;       //!< strafe left button
     45  static int PEV_STRAFE_RIGHT;      //!< strafe right button
    4846 
    49   static int PEV_FIRE1;
    50   static int PEV_FIRE2;
    51   static int PEV_PREVIOUS_WEAPON;
    52   static int PEV_NEXT_WEAPON;
     47  static int PEV_FIRE1;             //!< fire button 1
     48  static int PEV_FIRE2;             //!< fire button 2
     49  static int PEV_PREVIOUS_WEAPON;   //!< prev weapon button
     50  static int PEV_NEXT_WEAPON;       //!< next weapon button
    5351
    54   static int PEV_VIEW0;
    55   static int PEV_VIEW1;
    56   static int PEV_VIEW2;
    57   static int PEV_VIEW3;
    58   static int PEV_VIEW4;
    59   static int PEV_VIEW5;
     52  static int PEV_VIEW0;             //!< view 0 button
     53  static int PEV_VIEW1;             //!< view 1 button
     54  static int PEV_VIEW2;             //!< view 2 button
     55  static int PEV_VIEW3;             //!< view 3 button
     56  static int PEV_VIEW4;             //!< view 4 button
     57  static int PEV_VIEW5;             //!< view 5 button
    6058
    61   static int PEV_NEXT_WORLD;
    62   static int PEV_PREVIOUS_WORLD;
     59  static int PEV_NEXT_WORLD;        //!< next world button
     60  static int PEV_PREVIOUS_WORLD;    //!< prev world button
    6361
    64   static int PEV_PAUSE;
    65   static int PEV_QUIT;
     62  static int PEV_PAUSE;             //!< pause button
     63  static int PEV_QUIT;              //!< quit button
    6664
    6765 private:
    68   Sint32 coord[2];
     66  Sint32 coord[2];                   //!< temp place to save variables in nameToIndex() function
    6967};
    7068
Note: See TracChangeset for help on using the changeset viewer.