Changeset 6745 for code/branches/gamestates2/src/libraries/core
- Timestamp:
- Apr 16, 2010, 1:42:28 PM (15 years ago)
- Location:
- code/branches/gamestates2/src/libraries/core/input
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gamestates2/src/libraries/core/input/InputDevice.h
r6662 r6745 159 159 for (unsigned int iB = 0; iB < pressedButtons_.size(); ++iB) 160 160 for (unsigned int iS = 0; iS < inputStates_.size(); ++iS) 161 inputStates_[iS]->buttonEvent<ButtonEvent::THold, Traits::ButtonTypeParam>(161 inputStates_[iS]->buttonEvent<ButtonEvent::THold, typename Traits::ButtonTypeParam>( 162 162 this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(pressedButtons_[iB])); 163 163 … … 196 196 // Call states 197 197 for (unsigned int i = 0; i < inputStates_.size(); ++i) 198 inputStates_[i]->buttonEvent<ButtonEvent::TPress, Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));198 inputStates_[i]->buttonEvent<ButtonEvent::TPress, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button)); 199 199 } 200 200 … … 218 218 // Call states 219 219 for (unsigned int i = 0; i < inputStates_.size(); ++i) 220 inputStates_[i]->buttonEvent<ButtonEvent::TRelease, Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));220 inputStates_[i]->buttonEvent<ButtonEvent::TRelease, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button)); 221 221 } 222 222 -
code/branches/gamestates2/src/libraries/core/input/InputHandler.h
r6662 r6745 118 118 template<class T> void buttonEvent(unsigned int device, T button, ButtonEvent::THold) 119 119 { this->buttonHeld(button); } 120 template<> void buttonEvent<JoyStickButtonCode::ByEnum>(unsigned int device, JoyStickButtonCode::ByEnum button, ButtonEvent::TPress)121 { this->buttonPressed(device - InputDeviceEnumerator::FirstJoyStick, button); }122 template<> void buttonEvent<JoyStickButtonCode::ByEnum>(unsigned int device, JoyStickButtonCode::ByEnum button, ButtonEvent::TRelease)123 { this->buttonReleased(device - InputDeviceEnumerator::FirstJoyStick, button); }124 template<> void buttonEvent<JoyStickButtonCode::ByEnum>(unsigned int device, JoyStickButtonCode::ByEnum button, ButtonEvent::THold)125 { this->buttonHeld(device - InputDeviceEnumerator::FirstJoyStick, button); }126 120 127 121 virtual void buttonPressed (const KeyEvent& evt) { } … … 149 143 static InputHandler EMPTY; 150 144 }; 145 146 template<> inline void InputHandler::buttonEvent<JoyStickButtonCode::ByEnum>(unsigned int device, JoyStickButtonCode::ByEnum button, ButtonEvent::TPress) 147 { this->buttonPressed(device - InputDeviceEnumerator::FirstJoyStick, button); } 148 template<> inline void InputHandler::buttonEvent<JoyStickButtonCode::ByEnum>(unsigned int device, JoyStickButtonCode::ByEnum button, ButtonEvent::TRelease) 149 { this->buttonReleased(device - InputDeviceEnumerator::FirstJoyStick, button); } 150 template<> inline void InputHandler::buttonEvent<JoyStickButtonCode::ByEnum>(unsigned int device, JoyStickButtonCode::ByEnum button, ButtonEvent::THold) 151 { this->buttonHeld(device - InputDeviceEnumerator::FirstJoyStick, button); } 151 152 } 152 153 -
code/branches/gamestates2/src/libraries/core/input/InputState.h
r6662 r6745 205 205 206 206 template <typename EventType, class ButtonTypeParam> 207 FORCEINLINE void InputState::buttonEvent(unsigned int device, typenameButtonTypeParam button)207 FORCEINLINE void InputState::buttonEvent(unsigned int device, ButtonTypeParam button) 208 208 { 209 209 assert(device < handlers_.size());
Note: See TracChangeset
for help on using the changeset viewer.