Changeset 1195 for code/branches/input/src/core/InputManager.cc
- Timestamp:
- Apr 27, 2008, 6:20:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/input/src/core/InputManager.cc
r1193 r1195 155 155 try 156 156 { 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) 162 158 { 163 159 keyboard_ = (OIS::Keyboard*)inputSystem_->createInputObject(OIS::OISKeyboard, true); … … 185 181 try 186 182 { 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) 192 184 { 193 185 mouse_ = static_cast<OIS::Mouse*>(inputSystem_->createInputObject(OIS::OISMouse, true)); … … 212 204 void InputManager::_initialiseJoySticks() 213 205 { 214 #if (OIS_VERSION >> 8) == 0x0100215 if (inputSystem_->numJoySticks() > 0)216 {217 _setNumberOfJoysticks(inputSystem_->numJoySticks());218 #elif (OIS_VERSION >> 8) == 0x0102219 206 if (inputSystem_->getNumberOfDevices(OIS::OISJoyStick) > 0) 220 207 { 221 208 _setNumberOfJoysticks(inputSystem_->getNumberOfDevices(OIS::OISJoyStick)); 222 #endif223 209 for (std::vector<OIS::JoyStick*>::iterator it = joySticks_.begin(); it != joySticks_.end(); it++) 224 210 { … … 371 357 372 358 // ############################### 373 // ### Public Member Methods###359 // ### Interface Methods ### 374 360 // ############################### 375 361 376 362 /** 377 @brief Updates the InputManager 363 @brief Updates the InputManager. Tick is called by Orxonox. 378 364 @param dt Delta time 379 365 */ … … 394 380 this->bKeyBindingsActive_ = true; 395 381 this->bMouseButtonBindingsActive_ = true; 396 //this->bJoySticksButtonBindingsActive_ = true; 382 for (unsigned int i = 0; i < joySticks_.size(); i++) 383 this->bJoyStickButtonBindingsActive_[i] = true; 397 384 break; 398 385 … … 404 391 this->listenersKeyActive_.clear(); 405 392 this->listenersMouseActive_.clear(); 406 //this->listenersJoyStickActive_.clear();393 this->listenersJoySticksActive_.clear(); 407 394 this->bKeyBindingsActive_ = false; 408 395 this->bMouseButtonBindingsActive_ = true; 409 //this->bJoyStickButtonBindingsActive_ = true; 396 for (unsigned int i = 0; i < joySticks_.size(); i++) 397 this->bJoyStickButtonBindingsActive_[i] = true; 410 398 if (listenersKey_.find("buffer") != listenersKey_.end()) 411 399 listenersKeyActive_.push_back(listenersKey_["buffer"]); … … 421 409 this->listenersKeyActive_.clear(); 422 410 this->listenersMouseActive_.clear(); 423 //this->listenersJoyStickActive_.clear();411 this->listenersJoySticksActive_.clear(); 424 412 this->bKeyBindingsActive_ = false; 425 413 this->bMouseButtonBindingsActive_ = false; 426 //this->bJoyStickButtonBindingsActive_ = false; 414 for (unsigned int i = 0; i < joySticks_.size(); i++) 415 this->bJoyStickButtonBindingsActive_[i] = false; 427 416 break; 428 417 429 418 case IS_CUSTOM: 430 419 // don't do anything 420 break; 421 422 case IS_UNINIT: 423 // this can't happen 431 424 break; 432 425 } … … 619 612 } 620 613 614 /*bool InputManager::initialiseKeyboard() 615 { 616 } 617 618 bool InputManager::initialiseMouse() 619 { 620 } 621 622 bool InputManager::initialiseJoySticks() 623 { 624 }*/ 625 621 626 bool InputManager::addKeyListener(OIS::KeyListener *listener, const std::string& name) 622 627 {
Note: See TracChangeset
for help on using the changeset viewer.