Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 21, 2009, 8:47:11 PM (15 years ago)
Author:
rgrieder
Message:

Upgrade number two for the InputManager: An InputState can have two new properties. You can tell it to always receive input, no matter what the input stack actually is. Secondly there is a 'transparent' option to be kind of invisible to the other states. I have found no use yet, but three more lines weren't a big deal ;)
This change ultimately supersedes the need for a master InputState.

File:
1 edited

Legend:

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

    r2814 r2816  
    130130
    131131        template <class T>
    132         T* createInputState(const std::string& name, InputStatePriority priority = InputStatePriority::Dynamic);
     132        T* createInputState(const std::string& name, bool bAlwaysGetsInput = false, bool bTransparent = false, InputStatePriority priority = InputStatePriority::Dynamic);
    133133
    134134        InputState* getState       (const std::string& name);
    135135        InputState* getCurrentState();
    136         ExtendedInputState* getMasterInputState() { return this->stateMaster_; }
    137136        bool requestDestroyState   (const std::string& name);
    138137        bool requestEnterState     (const std::string& name);
     
    179178
    180179        void _updateActiveStates();
    181         bool _configureInputState(InputState* state, const std::string& name, int priority);
     180        bool _configureInputState(InputState* state, const std::string& name, bool bAlwaysGetsInput, bool bTransparent, int priority);
    182181
    183182        // input events
     
    211210        // some internally handled states and handlers
    212211        SimpleInputState*                   stateEmpty_;
    213         ExtendedInputState*                 stateMaster_;          //!< Always active master input state
    214212        KeyDetector*                        keyDetector_;          //!< KeyDetector instance
    215213        InputBuffer*                        calibratorCallbackBuffer_;
     
    222220
    223221        std::map<int, InputState*>          activeStates_;
    224         std::vector<InputState*>            activeStatesTop_;      //!< Current input states for joy stick events.
    225         std::vector<InputState*>            activeStatesTicked_;   //!< Current input states for joy stick events.
     222        std::vector<std::vector<InputState*> > activeStatesTriggered_;
     223        std::vector<InputState*>            activeStatesTicked_;
    226224
    227225        // joystick calibration
     
    262260    */
    263261    template <class T>
    264     T* InputManager::createInputState(const std::string& name, InputStatePriority priority)
     262    T* InputManager::createInputState(const std::string& name, bool bAlwaysGetsInput, bool bTransparent, InputStatePriority priority)
    265263    {
    266264        T* state = new T;
    267         if (_configureInputState(state, name, priority))
     265        if (_configureInputState(state, name, bAlwaysGetsInput, bTransparent, priority))
    268266            return state;
    269267        else
Note: See TracChangeset for help on using the changeset viewer.