Changeset 1259 for code/branches/input/src/core/InputManager.cc
- Timestamp:
- May 12, 2008, 7:06:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/input/src/core/InputManager.cc
r1239 r1259 52 52 InputManager::InputManager() : 53 53 inputSystem_(0), keyboard_(0), mouse_(0), 54 joySticksSize_(0), 54 55 state_(IS_UNINIT), stateRequest_(IS_UNINIT), 55 joySticksSize_(0)56 keyboardModifiers_(0) 56 57 { 57 58 RegisterObject(InputManager); 58 59 //this->joySticks_.reserve(5);60 //this->activeJoyStickHandlers_.reserve(10);61 this->activeKeyHandlers_.reserve(10);62 this->activeMouseHandlers_.reserve(10);63 59 } 64 60 … … 88 84 @param windowHeight The height of the render window 89 85 */ 90 bool InputManager::_initialise(const size_t windowHnd, const int windowWidth, constint windowHeight,91 const bool createKeyboard, const bool createMouse, constbool createJoySticks)86 bool InputManager::_initialise(const size_t windowHnd, int windowWidth, int windowHeight, 87 bool createKeyboard, bool createMouse, bool createJoySticks) 92 88 { 93 89 if (state_ == IS_UNINIT) … … 146 142 addKeyHandler(binder, "keybinder"); 147 143 addMouseHandler(binder, "keybinder"); 144 addJoyStickHandler(binder, "keybinder"); 148 145 149 146 // Read all the key bindings and assign them … … 267 264 } 268 265 joySticksSize_ = joySticks_.size(); 266 activeJoyStickHandlers_.resize(joySticksSize_); 267 joyStickButtonsDown_.resize(joySticksSize_); 269 268 return success; 270 269 } … … 375 374 activeKeyHandlers_.clear(); 376 375 activeMouseHandlers_.clear(); 377 activeJoyStickHandlers_.clear(); 376 for (unsigned int i = 0; i < joySticksSize_; i++) 377 activeJoyStickHandlers_[i].clear(); 378 378 379 379 switch (stateRequest_) … … 414 414 if (keyboard_) 415 415 keyboard_->capture(); 416 for (unsigned int i = 0; i < joySticksSize_; i++) 417 joySticks_[i]->capture(); 416 418 417 419 … … 428 430 // call all the handlers for the held joy stick button events 429 431 for (unsigned int iJoyStick = 0; iJoyStick < joySticksSize_; iJoyStick++) 430 for (unsigned int iButton = 0; iButton < joyStickButtonsDown_ .size(); iButton++)432 for (unsigned int iButton = 0; iButton < joyStickButtonsDown_[iJoyStick].size(); iButton++) 431 433 for (unsigned int iHandler = 0; iHandler < activeJoyStickHandlers_[iJoyStick].size(); iHandler++) 432 434 activeJoyStickHandlers_[iJoyStick][iHandler]->joyStickButtonHeld( … … 509 511 } 510 512 511 // check for mouse wheel turned event513 // check for mouse scrolled event 512 514 if (e.state.Z.rel != 0) 513 515 { 514 516 for (unsigned int i = 0; i < activeMouseHandlers_.size(); i++) 515 activeMouseHandlers_[i]->mouse WheelTurned(e.state);517 activeMouseHandlers_[i]->mouseScrolled(e.state); 516 518 } 517 519 … … 674 676 // ################################ 675 677 676 bool InputManager::initialise(const size_t windowHnd, const int windowWidth, constint windowHeight,677 const bool createKeyboard, const bool createMouse, constbool createJoySticks)678 bool InputManager::initialise(const size_t windowHnd, int windowWidth, int windowHeight, 679 bool createKeyboard, bool createMouse, bool createJoySticks) 678 680 { 679 681 return _getSingleton()._initialise(windowHnd, windowWidth, windowHeight,
Note: See TracChangeset
for help on using the changeset viewer.