Changeset 2849 for code/branches
- Timestamp:
- Mar 25, 2009, 11:50:23 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/core/input/InputManager.cc
r2816 r2849 747 747 if (!stateLeaveRequests_.empty()) 748 748 { 749 for (std::set<InputState*>:: reverse_iterator rit = stateLeaveRequests_.rbegin();750 rit != stateLeaveRequests_.rend(); ++rit)751 { 752 (* rit)->onLeave();749 for (std::set<InputState*>::iterator it = stateLeaveRequests_.begin(); 750 it != stateLeaveRequests_.end(); ++it) 751 { 752 (*it)->onLeave(); 753 753 // just to be sure that the state actually is registered 754 assert(inputStatesByName_.find((* rit)->getName()) != inputStatesByName_.end());755 756 activeStates_.erase((* rit)->getPriority());757 if ((* rit)->getPriority() < InputStatePriority::HighPriority)758 (* rit)->setPriority(0);754 assert(inputStatesByName_.find((*it)->getName()) != inputStatesByName_.end()); 755 756 activeStates_.erase((*it)->getPriority()); 757 if ((*it)->getPriority() < InputStatePriority::HighPriority) 758 (*it)->setPriority(0); 759 759 _updateActiveStates(); 760 760 } … … 765 765 if (!stateEnterRequests_.empty()) 766 766 { 767 for (std::set<InputState*>:: reverse_iterator rit = stateEnterRequests_.rbegin();768 rit != stateEnterRequests_.rend(); ++rit)767 for (std::set<InputState*>::const_iterator it = stateEnterRequests_.begin(); 768 it != stateEnterRequests_.end(); ++it) 769 769 { 770 770 // just to be sure that the state actually is registered 771 assert(inputStatesByName_.find((* rit)->getName()) != inputStatesByName_.end());772 773 if ((* rit)->getPriority() == 0)771 assert(inputStatesByName_.find((*it)->getName()) != inputStatesByName_.end()); 772 773 if ((*it)->getPriority() == 0) 774 774 { 775 775 // Get smallest possible priority between 1 and maxStateStackSize_s 776 for(std::map<int, InputState*>::const_reverse_iterator rit 2= activeStates_.rbegin();777 rit 2 != activeStates_.rend(); ++rit2)776 for(std::map<int, InputState*>::const_reverse_iterator rit = activeStates_.rbegin(); 777 rit != activeStates_.rend(); ++rit) 778 778 { 779 if (rit 2->first < InputStatePriority::HighPriority)779 if (rit->first < InputStatePriority::HighPriority) 780 780 { 781 (* rit)->setPriority(rit2->first + 1);781 (*it)->setPriority(rit->first + 1); 782 782 break; 783 783 } 784 784 } 785 785 // In case no normal handler was on the stack 786 if ((* rit)->getPriority() == 0)787 (* rit)->setPriority(1);786 if ((*it)->getPriority() == 0) 787 (*it)->setPriority(1); 788 788 } 789 activeStates_[(* rit)->getPriority()] = (*rit);789 activeStates_[(*it)->getPriority()] = (*it); 790 790 _updateActiveStates(); 791 (* rit)->onEnter();791 (*it)->onEnter(); 792 792 } 793 793 stateEnterRequests_.clear(); … … 797 797 if (!stateDestroyRequests_.empty()) 798 798 { 799 for (std::set<InputState*>:: reverse_iterator rit = stateDestroyRequests_.rbegin();800 rit != stateDestroyRequests_.rend(); ++rit)801 { 802 _destroyState((* rit));799 for (std::set<InputState*>::iterator it = stateDestroyRequests_.begin(); 800 it != stateDestroyRequests_.end(); ++it) 801 { 802 _destroyState((*it)); 803 803 } 804 804 stateDestroyRequests_.clear();
Note: See TracChangeset
for help on using the changeset viewer.