Changeset 2908 for code/branches/questsystem5/src/core/input/InputManager.h
- Timestamp:
- Apr 8, 2009, 12:58:47 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/core/input/InputManager.h
r2907 r2908 43 43 #include <stack> 44 44 #include "util/Math.h" 45 #include "util/OrxEnum.h"46 45 #include "core/OrxonoxClass.h" 47 46 #include "InputInterfaces.h" … … 75 74 float positiveCoeff[24]; 76 75 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;90 76 }; 91 77 … … 130 116 131 117 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); 133 119 134 120 InputState* getState (const std::string& name); 135 121 InputState* getCurrentState(); 122 ExtendedInputState* getMasterInputState() { return this->stateMaster_; } 136 123 bool requestDestroyState (const std::string& name); 137 124 bool requestEnterState (const std::string& name); 138 125 bool requestLeaveState (const std::string& name); 139 126 140 void update(const Clock& time);127 void tick(float dt); 141 128 142 129 static InputManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; } … … 178 165 179 166 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); 181 168 182 169 // input events … … 210 197 // some internally handled states and handlers 211 198 SimpleInputState* stateEmpty_; 199 ExtendedInputState* stateMaster_; //!< Always active master input state 212 200 KeyDetector* keyDetector_; //!< KeyDetector instance 213 201 InputBuffer* calibratorCallbackBuffer_; 214 202 215 203 std::map<std::string, InputState*> inputStatesByName_; 204 std::map<int, InputState*> inputStatesByPriority_; 216 205 217 206 std::set<InputState*> stateEnterRequests_; //!< Request to enter a new state … … 220 209 221 210 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. 224 213 225 214 // joystick calibration … … 260 249 */ 261 250 template <class T> 262 T* InputManager::createInputState(const std::string& name, bool bAlwaysGetsInput, bool bTransparent, InputStatePrioritypriority)251 T* InputManager::createInputState(const std::string& name, int priority) 263 252 { 264 253 T* state = new T; 265 if (_configureInputState(state, name, bAlwaysGetsInput, bTransparent,priority))254 if (_configureInputState(state, name, priority)) 266 255 return state; 267 256 else
Note: See TracChangeset
for help on using the changeset viewer.