Changeset 1878 for code/trunk/src/core/input/InputManager.cc
- Timestamp:
- Oct 3, 2008, 1:26:48 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/input/InputManager.cc
r1788 r1878 65 65 66 66 std::string InputManager::bindingCommmandString_s = ""; 67 EmptyHandler InputManager::EMPTY_HANDLER; 67 68 InputManager* InputManager::singletonRef_s = 0; 68 69 … … 189 190 190 191 stateEmpty_ = createInputState<SimpleInputState>("empty", -1); 191 stateEmpty_->setHandler( new EmptyHandler());192 stateEmpty_->setHandler(&EMPTY_HANDLER); 192 193 activeStates_[stateEmpty_->getPriority()] = stateEmpty_; 193 194 … … 198 199 199 200 stateCalibrator_ = createInputState<SimpleInputState>("calibrator", 100); 200 stateCalibrator_->setHandler( new EmptyHandler());201 stateCalibrator_->setHandler(&EMPTY_HANDLER); 201 202 InputBuffer* buffer = new InputBuffer(); 202 203 buffer->registerListener(this, &InputManager::_completeCalibration, '\r', true); … … 430 431 431 432 // clear our own states 432 stateEmpty_->removeAndDestroyAllHandlers(); 433 stateCalibrator_->removeAndDestroyAllHandlers(); 434 stateDetector_->removeAndDestroyAllHandlers(); 433 //stateEmpty_->removeAndDestroyAllHandlers(); 434 //stateCalibrator_->removeAndDestroyAllHandlers(); 435 //stateDetector_->removeAndDestroyAllHandlers(); 436 // TODO: Memory Leak when not deleting the handlers!!! 435 437 436 438 // kick all active states 'nicely' … … 680 682 } 681 683 stateDestroyRequests_.clear(); 684 685 // check whether a state has changed its EMPTY_HANDLER situation 686 bool bUpdateRequired = false; 687 for (std::map<int, InputState*>::iterator it = activeStates_.begin(); it != activeStates_.end(); ++it) 688 { 689 if (it->second->handlersChanged()) 690 { 691 it->second->resetHandlersChanged(); 692 bUpdateRequired = true; 693 } 694 } 695 if (bUpdateRequired) 696 _updateActiveStates(); 682 697 683 698 // mark that we capture and distribute input … … 826 841 requestLeaveState("calibrator"); 827 842 bCalibrating_ = false; 843 } 844 845 void InputManager::clearBuffers() 846 { 847 this->keysDown_.clear(); 848 this->mouseButtonsDown_.clear(); 849 for (unsigned int i = 0; i < this->joySticksSize_; ++i) 850 this->joyStickButtonsDown_[i].clear(); 828 851 } 829 852
Note: See TracChangeset
for help on using the changeset viewer.