Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2009, 12:58:47 AM (15 years ago)
Author:
dafrick
Message:

Reverted to revision 2906 (because I'm too stupid to merge correctly, 2nd try will follow shortly. ;))

Location:
code/branches/questsystem5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem5

  • code/branches/questsystem5/src/core/input/InputManager.h

    r2907 r2908  
    4343#include <stack>
    4444#include "util/Math.h"
    45 #include "util/OrxEnum.h"
    4645#include "core/OrxonoxClass.h"
    4746#include "InputInterfaces.h"
     
    7574        float positiveCoeff[24];
    7675        float negativeCoeff[24];
    77     };
    78 
    79     struct InputStatePriority : OrxEnum<InputStatePriority>
    80     {
    81         OrxEnumConstructors(InputStatePriority);
    82 
    83         static const int Empty        = -1;
    84         static const int Dynamic      = 0;
    85 
    86         static const int HighPriority = 1000;
    87         static const int Console      = HighPriority + 0;
    88         static const int Calibrator   = HighPriority + 1;
    89         static const int Detector     = HighPriority + 2;
    9076    };
    9177
     
    130116
    131117        template <class T>
    132         T* createInputState(const std::string& name, bool bAlwaysGetsInput = false, bool bTransparent = false, InputStatePriority priority = InputStatePriority::Dynamic);
     118        T* createInputState(const std::string& name, int priority);
    133119
    134120        InputState* getState       (const std::string& name);
    135121        InputState* getCurrentState();
     122        ExtendedInputState* getMasterInputState() { return this->stateMaster_; }
    136123        bool requestDestroyState   (const std::string& name);
    137124        bool requestEnterState     (const std::string& name);
    138125        bool requestLeaveState     (const std::string& name);
    139126
    140         void update(const Clock& time);
     127        void tick(float dt);
    141128
    142129        static InputManager& getInstance()    { assert(singletonRef_s); return *singletonRef_s; }
     
    178165
    179166        void _updateActiveStates();
    180         bool _configureInputState(InputState* state, const std::string& name, bool bAlwaysGetsInput, bool bTransparent, int priority);
     167        bool _configureInputState(InputState* state, const std::string& name, int priority);
    181168
    182169        // input events
     
    210197        // some internally handled states and handlers
    211198        SimpleInputState*                   stateEmpty_;
     199        ExtendedInputState*                 stateMaster_;          //!< Always active master input state
    212200        KeyDetector*                        keyDetector_;          //!< KeyDetector instance
    213201        InputBuffer*                        calibratorCallbackBuffer_;
    214202
    215203        std::map<std::string, InputState*>  inputStatesByName_;
     204        std::map<int, InputState*>          inputStatesByPriority_;
    216205
    217206        std::set<InputState*>               stateEnterRequests_;   //!< Request to enter a new state
     
    220209
    221210        std::map<int, InputState*>          activeStates_;
    222         std::vector<std::vector<InputState*> > activeStatesTriggered_;
    223         std::vector<InputState*>            activeStatesTicked_;
     211        std::vector<InputState*>            activeStatesTop_;      //!< Current input states for joy stick events.
     212        std::vector<InputState*>            activeStatesTicked_;   //!< Current input states for joy stick events.
    224213
    225214        // joystick calibration
     
    260249    */
    261250    template <class T>
    262     T* InputManager::createInputState(const std::string& name, bool bAlwaysGetsInput, bool bTransparent, InputStatePriority priority)
     251    T* InputManager::createInputState(const std::string& name, int priority)
    263252    {
    264253        T* state = new T;
    265         if (_configureInputState(state, name, bAlwaysGetsInput, bTransparent, priority))
     254        if (_configureInputState(state, name, priority))
    266255            return state;
    267256        else
Note: See TracChangeset for help on using the changeset viewer.