- Timestamp:
- Nov 21, 2015, 7:05:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc
r10778 r10821 373 373 // check whether a state has changed its EMPTY situation 374 374 bool bUpdateRequired = false; 375 for ( std::map<int, InputState*>::iterator it = activeStates_.begin(); it != activeStates_.end(); ++it)376 { 377 if ( it->second->hasExpired())378 { 379 it->second->resetExpiration();375 for (auto & elem : activeStates_) 376 { 377 if (elem.second->hasExpired()) 378 { 379 elem.second->resetExpiration(); 380 380 bUpdateRequired = true; 381 381 } … … 391 391 392 392 // Collect function calls for the update 393 for ( unsigned int i = 0; i < activeStatesTicked_.size(); ++i)394 activeStatesTicked_[i]->update(time.getDeltaTime());393 for (auto & elem : activeStatesTicked_) 394 elem->update(time.getDeltaTime()); 395 395 396 396 // Execute all cached function calls in order … … 401 401 // If we delay the calls, then OIS and and the InputStates are not anymore 402 402 // in the call stack and can therefore be edited. 403 for ( size_t i = 0; i < this->callBuffer_.size(); ++i)404 this->callBuffer_[i]();403 for (auto & elem : this->callBuffer_) 404 elem(); 405 405 406 406 this->callBuffer_.clear(); … … 437 437 // Using an std::set to avoid duplicates 438 438 std::set<InputState*> tempSet; 439 for ( unsigned int i = 0; i < devices_.size(); ++i)440 if ( devices_[i]!= nullptr)441 for (unsigned int iState = 0; iState < devices_[i]->getStateListRef().size(); ++iState)442 tempSet.insert( devices_[i]->getStateListRef()[iState]);439 for (auto & elem : devices_) 440 if (elem != nullptr) 441 for (unsigned int iState = 0; iState < elem->getStateListRef().size(); ++iState) 442 tempSet.insert(elem->getStateListRef()[iState]); 443 443 444 444 // Copy the content of the std::set back to the actual vector 445 445 activeStatesTicked_.clear(); 446 for ( std::set<InputState*>::const_iterator it = tempSet.begin();it != tempSet.end(); ++it)447 activeStatesTicked_.push_back( *it);446 for (const auto & elem : tempSet) 447 activeStatesTicked_.push_back(elem); 448 448 449 449 // Check whether we have to change the mouse mode
Note: See TracChangeset
for help on using the changeset viewer.