Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 27, 2008, 10:21:39 PM (16 years ago)
Author:
rgrieder
Message:
  • Changed GameState so that the new RootGameState can override 2 virtual methods
  • added RootGameState that takes care of state transitions (can only happen between ticks)
  • moved main loop to GSRoot instead of GSGraphics
  • network GameStates not yet finished
  • GraphicsEngine not yet merged into GSGraphics
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/core/input/InputManager.cc

    r1670 r1672  
    640640
    641641        // check for states to leave
    642         for (std::set<InputState*>::reverse_iterator it = stateLeaveRequests_.rbegin();
    643             it != stateLeaveRequests_.rend(); ++it)
    644         {
    645             (*it)->onLeave();
     642        for (std::set<InputState*>::reverse_iterator rit = stateLeaveRequests_.rbegin();
     643            rit != stateLeaveRequests_.rend(); ++rit)
     644        {
     645            (*rit)->onLeave();
    646646            // just to be sure that the state actually is registered
    647             assert(inputStatesByName_.find((*it)->getName()) != inputStatesByName_.end());
    648 
    649             activeStates_.erase((*it)->getPriority());
     647            assert(inputStatesByName_.find((*rit)->getName()) != inputStatesByName_.end());
     648
     649            activeStates_.erase((*rit)->getPriority());
    650650            _updateActiveStates();
    651651        }
     
    653653
    654654        // check for states to enter
    655         for (std::set<InputState*>::reverse_iterator it = stateEnterRequests_.rbegin();
    656             it != stateEnterRequests_.rend(); ++it)
     655        for (std::set<InputState*>::reverse_iterator rit = stateEnterRequests_.rbegin();
     656            rit != stateEnterRequests_.rend(); ++rit)
    657657        {
    658658            // just to be sure that the state actually is registered
    659             assert(inputStatesByName_.find((*it)->getName()) != inputStatesByName_.end());
    660 
    661             activeStates_[(*it)->getPriority()] = (*it);
     659            assert(inputStatesByName_.find((*rit)->getName()) != inputStatesByName_.end());
     660
     661            activeStates_[(*rit)->getPriority()] = (*rit);
    662662            _updateActiveStates();
    663             (*it)->onEnter();
     663            (*rit)->onEnter();
    664664        }
    665665        stateEnterRequests_.clear();
    666666
    667667        // check for states to destroy
    668         for (std::set<InputState*>::reverse_iterator it = stateDestroyRequests_.rbegin();
    669             it != stateDestroyRequests_.rend(); ++it)
    670         {
    671             _destroyState((*it));
     668        for (std::set<InputState*>::reverse_iterator rit = stateDestroyRequests_.rbegin();
     669            rit != stateDestroyRequests_.rend(); ++rit)
     670        {
     671            _destroyState((*rit));
    672672        }
    673673
Note: See TracChangeset for help on using the changeset viewer.