- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/libraries/core/input/InputState.h
r8729 r11054 35 35 #include <string> 36 36 #include <vector> 37 #include <boost/function.hpp> 38 #include <boost/bind.hpp> 37 #include <functional> 39 38 40 39 #include "util/tribool.h" … … 44 43 45 44 #define INPUT_STATE_PUSH_CALL(deviceIndex, functionName, ...) \ 46 InputManager::getInstance().pushCall( boost::function<void ()>(boost::bind(&InputHandler::functionName, handlers_[deviceIndex], __VA_ARGS__)))45 InputManager::getInstance().pushCall(std::function<void ()>(std::bind(&InputHandler::functionName, handlers_[deviceIndex], __VA_ARGS__))) 47 46 48 47 namespace orxonox … … 156 155 private: 157 156 InputState(const std::string& name, bool bAlwaysGetsInput, bool bTransparent, InputStatePriority priority); 158 ~InputState() { }159 160 v oid JoyStickQuantityChanged(const std::vector<JoyStick*>& joyStickList);157 ~InputState() = default; 158 159 virtual void JoyStickQuantityChanged(const std::vector<JoyStick*>& joyStickList) override; 161 160 162 161 //! Sets the priority (only to be used by the InputManager!) … … 179 178 { 180 179 for (unsigned int i = 0; i < handlers_.size(); ++i) 181 if (handlers_[i] != NULL)180 if (handlers_[i] != nullptr) 182 181 INPUT_STATE_PUSH_CALL(i, allDevicesUpdated, dt); 183 182 } … … 188 187 { 189 188 case InputDeviceEnumerator::Keyboard: 190 if (handlers_[keyboardIndex_s] != NULL)189 if (handlers_[keyboardIndex_s] != nullptr) 191 190 INPUT_STATE_PUSH_CALL(keyboardIndex_s, keyboardUpdated, dt); 192 191 break; 193 192 194 193 case InputDeviceEnumerator::Mouse: 195 if (handlers_[mouseIndex_s] != NULL)194 if (handlers_[mouseIndex_s] != nullptr) 196 195 INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseUpdated, dt); 197 196 break; 198 197 199 198 default: // joy sticks 200 if (handlers_[device] != NULL)199 if (handlers_[device] != nullptr) 201 200 INPUT_STATE_PUSH_CALL(device, joyStickUpdated, device - firstJoyStickIndex_s, dt); 202 201 break; … … 208 207 { 209 208 assert(device < handlers_.size()); 210 if (handlers_[device] != NULL)209 if (handlers_[device] != nullptr) 211 210 { 212 211 // We have to store the function pointer to tell the compiler about its actual type because of overloading 213 212 void (InputHandler::*function)(unsigned int, ButtonTypeParam, EventType) = &InputHandler::buttonEvent<ButtonTypeParam>; 214 InputManager::getInstance().pushCall( boost::function<void ()>(boost::bind(function, handlers_[device], device, button, EventType())));213 InputManager::getInstance().pushCall(std::function<void ()>(std::bind(function, handlers_[device], device, button, EventType()))); 215 214 } 216 215 } … … 218 217 ORX_FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) 219 218 { 220 if (handlers_[mouseIndex_s] != NULL)219 if (handlers_[mouseIndex_s] != nullptr) 221 220 INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseMoved, abs, rel, clippingSize); 222 221 } … … 224 223 ORX_FORCEINLINE void InputState::mouseScrolled(int abs, int rel) 225 224 { 226 if (handlers_[mouseIndex_s] != NULL)225 if (handlers_[mouseIndex_s] != nullptr) 227 226 INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseScrolled, abs, rel); 228 227 } … … 231 230 { 232 231 assert(device < handlers_.size()); 233 if (handlers_[device] != NULL)232 if (handlers_[device] != nullptr) 234 233 INPUT_STATE_PUSH_CALL(device, axisMoved, device - firstJoyStickIndex_s, axis, value); 235 234 }
Note: See TracChangeset
for help on using the changeset viewer.