Changeset 3327 for code/trunk/src/core/input/InputState.cc
- Timestamp:
- Jul 19, 2009, 5:31:02 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core4 merged: 3269,3271-3275,3278,3285,3290-3294,3310
- Property svn:mergeinfo changed
-
code/trunk/src/core/input/InputState.cc
r3276 r3327 32 32 namespace orxonox 33 33 { 34 InputState::InputState() 35 : priority_(0) 36 , bAlwaysGetsInput_(false) 37 , bTransparent_(false) 34 //! Sets priority of it's a high priority and resizes the handler list 35 InputState::InputState(const std::string& name, bool bAlwaysGetsInput, bool bTransparent, InputStatePriority priority) 36 : name_(name) 37 , bAlwaysGetsInput_(bAlwaysGetsInput) 38 , bTransparent_(bTransparent) 38 39 , bExpired_(true) 39 40 , handlers_(2) … … 42 43 , leaveFunctor_(0) 43 44 { 45 if (priority >= InputStatePriority::HighPriority || priority == InputStatePriority::Empty) 46 priority_ = priority; 47 else 48 priority_ = 0; 49 50 handlers_.resize(InputDeviceEnumerator::FirstJoyStick + this->getJoyStickList().size(), NULL); 44 51 } 45 52 … … 52 59 } 53 60 54 void InputState::JoyStickQuantityChanged(unsigned int n) 61 //! Called by JoyStickQuantityListener upon joy stick adding/removal 62 void InputState::JoyStickQuantityChanged(const std::vector<JoyStick*>& joyStickList) 55 63 { 56 64 unsigned int oldSize = handlers_.size(); 57 handlers_.resize(InputDeviceEnumerator::FirstJoyStick + n, NULL);65 handlers_.resize(InputDeviceEnumerator::FirstJoyStick + joyStickList.size(), NULL); 58 66 59 67 for (unsigned int i = oldSize; i < handlers_.size(); ++i) … … 63 71 } 64 72 65 /**66 @brief67 Adds a joy stick handler.68 @param handler69 Pointer to the handler object.70 @param joyStickID71 ID of the joy stick72 @return73 True if added, false otherwise.74 */75 73 bool InputState::setJoyStickHandler(InputHandler* handler, unsigned int joyStick) 76 74 { … … 84 82 } 85 83 86 /** 87 @brief 88 Adds a joy stick handler. 89 @param handler 90 Pointer to the handler object. 91 @return 92 True if added, false if handler already existed. 93 */ 94 bool InputState::setJoyStickHandler(InputHandler* handler) 84 void InputState::setJoyStickHandler(InputHandler* handler) 95 85 { 96 86 joyStickHandlerAll_ = handler; … … 98 88 handlers_[i] = handler; 99 89 bExpired_ = true; 100 return true;101 90 } 102 91 103 /** 104 @brief 105 Adds a handler of any kind. dynamic_cast determines to which list it is added. 106 @param handler 107 Pointer to the handler object. 108 @return 109 True if added, false if handler already existed. 110 */ 111 bool InputState::setHandler(InputHandler* handler) 92 void InputState::setHandler(InputHandler* handler) 112 93 { 113 94 setKeyHandler(handler); 114 95 setMouseHandler(handler); 115 returnsetJoyStickHandler(handler);96 setJoyStickHandler(handler); 116 97 } 117 98
Note: See TracChangeset
for help on using the changeset viewer.