Changeset 10765 for code/branches/cpp11_v2/src/libraries/core/input
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/libraries/core/input
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc
r10624 r10765 210 210 catch (const std::exception& ex) 211 211 { 212 oisInputManager_ = NULL;212 oisInputManager_ = nullptr; 213 213 internalState_ |= Bad; 214 214 ThrowException(InitialisationFailed, "Could not initialise the input system: " << ex.what()); … … 312 312 BOOST_FOREACH(InputDevice*& device, devices_) 313 313 { 314 if (device == NULL)314 if (device == nullptr) 315 315 continue; 316 316 const std::string& className = device->getClassName(); … … 321 321 devices_.resize(InputDeviceEnumerator::FirstJoyStick); 322 322 323 assert(oisInputManager_ != NULL);323 assert(oisInputManager_ != nullptr); 324 324 try 325 325 { … … 331 331 << "Potential resource leak!" << endl; 332 332 } 333 oisInputManager_ = NULL;333 oisInputManager_ = nullptr; 334 334 335 335 internalState_ |= Bad; … … 388 388 // No event gets triggered here yet! 389 389 BOOST_FOREACH(InputDevice* device, devices_) 390 if (device != NULL)390 if (device != nullptr) 391 391 device->update(time); 392 392 … … 419 419 for (unsigned int i = 0; i < devices_.size(); ++i) 420 420 { 421 if (devices_[i] == NULL)421 if (devices_[i] == nullptr) 422 422 continue; 423 423 std::vector<InputState*>& states = devices_[i]->getStateListRef(); … … 439 439 std::set<InputState*> tempSet; 440 440 for (unsigned int i = 0; i < devices_.size(); ++i) 441 if (devices_[i] != NULL)441 if (devices_[i] != nullptr) 442 442 for (unsigned int iState = 0; iState < devices_[i]->getStateListRef().size(); ++iState) 443 443 tempSet.insert(devices_[i]->getStateListRef()[iState]); … … 467 467 { 468 468 BOOST_FOREACH(InputDevice* device, devices_) 469 if (device != NULL)469 if (device != nullptr) 470 470 device->clearBuffers(); 471 471 } … … 477 477 478 478 BOOST_FOREACH(InputDevice* device, devices_) 479 if (device != NULL)479 if (device != nullptr) 480 480 device->startCalibration(); 481 481 … … 488 488 { 489 489 BOOST_FOREACH(InputDevice* device, devices_) 490 if (device != NULL)490 if (device != nullptr) 491 491 device->stopCalibration(); 492 492 … … 509 509 { 510 510 Mouse* mouse = static_cast<Mouse*>(devices_[InputDeviceEnumerator::Mouse]); 511 if (mouse != NULL)511 if (mouse != nullptr) 512 512 { 513 513 const OIS::MouseState state = mouse->getOISDevice()->getMouseState(); -
code/branches/cpp11_v2/src/libraries/core/input/InputManager.h
r8729 r10765 134 134 Returns a pointer to a InputState referenced by name. 135 135 @return 136 Returns NULLif state was not found.136 Returns nullptr if state was not found. 137 137 */ 138 138 InputState* getState(const std::string& name); -
code/branches/cpp11_v2/src/libraries/core/input/InputState.cc
r8729 r10765 49 49 priority_ = 0; 50 50 51 handlers_.resize(InputDeviceEnumerator::FirstJoyStick + this->getJoyStickList().size(), NULL);51 handlers_.resize(InputDeviceEnumerator::FirstJoyStick + this->getJoyStickList().size(), nullptr); 52 52 } 53 53 … … 55 55 { 56 56 if (device < handlers_.size()) 57 return handlers_[device] != NULL;57 return handlers_[device] != nullptr; 58 58 else 59 59 return false; … … 64 64 { 65 65 unsigned int oldSize = handlers_.size(); 66 handlers_.resize(InputDeviceEnumerator::FirstJoyStick + joyStickList.size(), NULL);66 handlers_.resize(InputDeviceEnumerator::FirstJoyStick + joyStickList.size(), nullptr); 67 67 68 68 for (unsigned int i = oldSize; i < handlers_.size(); ++i) -
code/branches/cpp11_v2/src/libraries/core/input/InputState.h
r8729 r10765 179 179 { 180 180 for (unsigned int i = 0; i < handlers_.size(); ++i) 181 if (handlers_[i] != NULL)181 if (handlers_[i] != nullptr) 182 182 INPUT_STATE_PUSH_CALL(i, allDevicesUpdated, dt); 183 183 } … … 188 188 { 189 189 case InputDeviceEnumerator::Keyboard: 190 if (handlers_[keyboardIndex_s] != NULL)190 if (handlers_[keyboardIndex_s] != nullptr) 191 191 INPUT_STATE_PUSH_CALL(keyboardIndex_s, keyboardUpdated, dt); 192 192 break; 193 193 194 194 case InputDeviceEnumerator::Mouse: 195 if (handlers_[mouseIndex_s] != NULL)195 if (handlers_[mouseIndex_s] != nullptr) 196 196 INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseUpdated, dt); 197 197 break; 198 198 199 199 default: // joy sticks 200 if (handlers_[device] != NULL)200 if (handlers_[device] != nullptr) 201 201 INPUT_STATE_PUSH_CALL(device, joyStickUpdated, device - firstJoyStickIndex_s, dt); 202 202 break; … … 208 208 { 209 209 assert(device < handlers_.size()); 210 if (handlers_[device] != NULL)210 if (handlers_[device] != nullptr) 211 211 { 212 212 // We have to store the function pointer to tell the compiler about its actual type because of overloading … … 218 218 ORX_FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) 219 219 { 220 if (handlers_[mouseIndex_s] != NULL)220 if (handlers_[mouseIndex_s] != nullptr) 221 221 INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseMoved, abs, rel, clippingSize); 222 222 } … … 224 224 ORX_FORCEINLINE void InputState::mouseScrolled(int abs, int rel) 225 225 { 226 if (handlers_[mouseIndex_s] != NULL)226 if (handlers_[mouseIndex_s] != nullptr) 227 227 INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseScrolled, abs, rel); 228 228 } … … 231 231 { 232 232 assert(device < handlers_.size()); 233 if (handlers_[device] != NULL)233 if (handlers_[device] != nullptr) 234 234 INPUT_STATE_PUSH_CALL(device, axisMoved, device - firstJoyStickIndex_s, axis, value); 235 235 } -
code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc
r10624 r10765 53 53 : deriveTime_(0.0f) 54 54 , filename_(filename) 55 , configFile_( NULL)56 , fallbackConfigFile_( NULL)55 , configFile_(nullptr) 56 , fallbackConfigFile_(nullptr) 57 57 { 58 58 mouseRelative_[0] = 0; … … 170 170 171 171 // load the bindings if required 172 if (configFile_ != NULL)172 if (configFile_ != nullptr) 173 173 { 174 174 for (unsigned int iDev = oldValue; iDev < joySticks_.size(); ++iDev) -
code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.h
r9978 r10765 159 159 //! Name of the file used in this KeyBinder (constant!) 160 160 const std::string filename_; 161 //! Config file used. NULLin case of KeyDetector. Also indicates whether we've already loaded.161 //! Config file used. nullptr in case of KeyDetector. Also indicates whether we've already loaded. 162 162 ConfigFile* configFile_; 163 163 //! Config file from the data directory that only serves as fallback -
code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.cc
r10624 r10765 56 56 57 57 KeyBinderManager::KeyBinderManager() 58 : currentBinder_( NULL)58 : currentBinder_(nullptr) 59 59 , bDefaultFileLoaded_(true) 60 60 , bBinding_(false) -
code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.h
r9667 r10765 107 107 108 108 // KeyBinder management 109 KeyBinder* currentBinder_; //! Currently selected KeyBinder (never NULL!)109 KeyBinder* currentBinder_; //! Currently selected KeyBinder (never nullptr!) 110 110 std::map<std::string, KeyBinder*> binders_; //! All loaded KeyBinders 111 111 bool bDefaultFileLoaded_; //! Tells whether the default one is loaded -
code/branches/cpp11_v2/src/libraries/core/input/KeyDetector.cc
r10624 r10765 62 62 KeyDetector::~KeyDetector() 63 63 { 64 inputState_->setHandler( NULL);64 inputState_->setHandler(nullptr); 65 65 InputManager::getInstance().destroyState("detector"); 66 66 ModifyConsoleCommand(__CC_KeyDetector_callback_name).resetFunction();
Note: See TracChangeset
for help on using the changeset viewer.