- Timestamp:
- Dec 28, 2008, 11:56:31 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/core/input/InputManager.cc
r2103 r2543 65 65 SetCommandLineSwitch(keyboard_no_grab); 66 66 67 std::string InputManager::bindingCommmandString_s = "";68 67 EmptyHandler InputManager::EMPTY_HANDLER; 69 68 InputManager* InputManager::singletonRef_s = 0; … … 174 173 if (joyStickSupport) 175 174 _initialiseJoySticks(); 176 // Do this anyway to also inform every one ifa joystick was detached.175 // Do this anyway to also inform everything when a joystick was detached. 177 176 _configureNumberOfJoySticks(); 178 177 … … 492 491 } 493 492 } 494 singletonRef_s = 0; 493 494 singletonRef_s = 0; 495 495 } 496 496 … … 660 660 /** 661 661 @brief 662 Updates the InputManager. Tick is called by the Core class.662 Updates the states and the InputState situation. 663 663 @param dt 664 664 Delta time … … 676 676 677 677 // check for states to leave 678 for (std::set<InputState*>::reverse_iterator rit = stateLeaveRequests_.rbegin(); 679 rit != stateLeaveRequests_.rend(); ++rit) 680 { 681 (*rit)->onLeave(); 682 // just to be sure that the state actually is registered 683 assert(inputStatesByName_.find((*rit)->getName()) != inputStatesByName_.end()); 684 685 activeStates_.erase((*rit)->getPriority()); 686 _updateActiveStates(); 687 } 688 stateLeaveRequests_.clear(); 678 if (!stateLeaveRequests_.empty()) 679 { 680 for (std::set<InputState*>::reverse_iterator rit = stateLeaveRequests_.rbegin(); 681 rit != stateLeaveRequests_.rend(); ++rit) 682 { 683 (*rit)->onLeave(); 684 // just to be sure that the state actually is registered 685 assert(inputStatesByName_.find((*rit)->getName()) != inputStatesByName_.end()); 686 687 activeStates_.erase((*rit)->getPriority()); 688 _updateActiveStates(); 689 } 690 stateLeaveRequests_.clear(); 691 } 689 692 690 693 // check for states to enter 691 for (std::set<InputState*>::reverse_iterator rit = stateEnterRequests_.rbegin(); 692 rit != stateEnterRequests_.rend(); ++rit) 693 { 694 // just to be sure that the state actually is registered 695 assert(inputStatesByName_.find((*rit)->getName()) != inputStatesByName_.end()); 696 697 activeStates_[(*rit)->getPriority()] = (*rit); 698 _updateActiveStates(); 699 (*rit)->onEnter(); 700 } 701 stateEnterRequests_.clear(); 694 if (!stateEnterRequests_.empty()) 695 { 696 for (std::set<InputState*>::reverse_iterator rit = stateEnterRequests_.rbegin(); 697 rit != stateEnterRequests_.rend(); ++rit) 698 { 699 // just to be sure that the state actually is registered 700 assert(inputStatesByName_.find((*rit)->getName()) != inputStatesByName_.end()); 701 702 activeStates_[(*rit)->getPriority()] = (*rit); 703 _updateActiveStates(); 704 (*rit)->onEnter(); 705 } 706 stateEnterRequests_.clear(); 707 } 702 708 703 709 // check for states to destroy 704 for (std::set<InputState*>::reverse_iterator rit = stateDestroyRequests_.rbegin(); 705 rit != stateDestroyRequests_.rend(); ++rit) 706 { 707 _destroyState((*rit)); 708 } 709 stateDestroyRequests_.clear(); 710 if (!stateDestroyRequests_.empty()) 711 { 712 for (std::set<InputState*>::reverse_iterator rit = stateDestroyRequests_.rbegin(); 713 rit != stateDestroyRequests_.rend(); ++rit) 714 { 715 _destroyState((*rit)); 716 } 717 stateDestroyRequests_.clear(); 718 } 710 719 711 720 // check whether a state has changed its EMPTY_HANDLER situation … … 1124 1133 1125 1134 // keep in mind that the first 8 axes are reserved for the sliders 1126 _fireAxis(iJoyStick, axis + 8, arg.state.mAxes[axis].abs);1135 _fireAxis(iJoyStick, axis + sliderAxes, arg.state.mAxes[axis].abs); 1127 1136 1128 1137 return true;
Note: See TracChangeset
for help on using the changeset viewer.