Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 27, 2008, 6:20:12 PM (16 years ago)
Author:
rgrieder
Message:
  • added OIS to the orxonox src directory
  • adapted VS files
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/input/src/core/InputManager.cc

    r1193 r1195  
    155155    try
    156156    {
    157 #if (OIS_VERSION >> 8) == 0x0100
    158     if (inputSystem_->numKeyboards() > 0)
    159 #elif (OIS_VERSION >> 8) == 0x0102
    160     if (inputSystem_->getNumberOfDevices(OIS::OISKeyboard) > 0)
    161 #endif
     157      if (inputSystem_->getNumberOfDevices(OIS::OISKeyboard) > 0)
    162158      {
    163159        keyboard_ = (OIS::Keyboard*)inputSystem_->createInputObject(OIS::OISKeyboard, true);
     
    185181    try
    186182    {
    187 #if (OIS_VERSION >> 8) == 0x0100
    188     if (inputSystem_->numMice() > 0)
    189 #elif (OIS_VERSION >> 8) == 0x0102
    190     if (inputSystem_->getNumberOfDevices(OIS::OISMouse) > 0)
    191 #endif
     183      if (inputSystem_->getNumberOfDevices(OIS::OISMouse) > 0)
    192184      {
    193185        mouse_ = static_cast<OIS::Mouse*>(inputSystem_->createInputObject(OIS::OISMouse, true));
     
    212204  void InputManager::_initialiseJoySticks()
    213205  {
    214 #if (OIS_VERSION >> 8) == 0x0100
    215     if (inputSystem_->numJoySticks() > 0)
    216     {
    217       _setNumberOfJoysticks(inputSystem_->numJoySticks());
    218 #elif (OIS_VERSION >> 8) == 0x0102
    219206    if (inputSystem_->getNumberOfDevices(OIS::OISJoyStick) > 0)
    220207    {
    221208      _setNumberOfJoysticks(inputSystem_->getNumberOfDevices(OIS::OISJoyStick));
    222 #endif
    223209      for (std::vector<OIS::JoyStick*>::iterator it = joySticks_.begin(); it != joySticks_.end(); it++)
    224210      {
     
    371357
    372358  // ###############################
    373   // ###  Public Member Methods  ###
     359  // ###    Interface Methods    ###
    374360  // ###############################
    375361
    376362  /**
    377     @brief Updates the InputManager
     363    @brief Updates the InputManager. Tick is called by Orxonox.
    378364    @param dt Delta time
    379365  */
     
    394380        this->bKeyBindingsActive_            = true;
    395381        this->bMouseButtonBindingsActive_    = true;
    396         //this->bJoySticksButtonBindingsActive_ = true;
     382        for (unsigned int i = 0; i < joySticks_.size(); i++)
     383          this->bJoyStickButtonBindingsActive_[i] = true;
    397384        break;
    398385
     
    404391        this->listenersKeyActive_.clear();
    405392        this->listenersMouseActive_.clear();
    406         //this->listenersJoyStickActive_.clear();
     393        this->listenersJoySticksActive_.clear();
    407394        this->bKeyBindingsActive_            = false;
    408395        this->bMouseButtonBindingsActive_    = true;
    409         //this->bJoyStickButtonBindingsActive_ = true;
     396        for (unsigned int i = 0; i < joySticks_.size(); i++)
     397          this->bJoyStickButtonBindingsActive_[i] = true;
    410398        if (listenersKey_.find("buffer") != listenersKey_.end())
    411399          listenersKeyActive_.push_back(listenersKey_["buffer"]);
     
    421409        this->listenersKeyActive_.clear();
    422410        this->listenersMouseActive_.clear();
    423         //this->listenersJoyStickActive_.clear();
     411        this->listenersJoySticksActive_.clear();
    424412        this->bKeyBindingsActive_            = false;
    425413        this->bMouseButtonBindingsActive_    = false;
    426         //this->bJoyStickButtonBindingsActive_ = false;
     414        for (unsigned int i = 0; i < joySticks_.size(); i++)
     415          this->bJoyStickButtonBindingsActive_[i] = false;
    427416        break;
    428417
    429418      case IS_CUSTOM:
    430419        // don't do anything
     420        break;
     421
     422      case IS_UNINIT:
     423        // this can't happen
    431424        break;
    432425      }
     
    619612  }
    620613
     614  /*bool InputManager::initialiseKeyboard()
     615  {
     616  }
     617
     618  bool InputManager::initialiseMouse()
     619  {
     620  }
     621
     622  bool InputManager::initialiseJoySticks()
     623  {
     624  }*/
     625
    621626  bool InputManager::addKeyListener(OIS::KeyListener *listener, const std::string& name)
    622627  {
Note: See TracChangeset for help on using the changeset viewer.