Changeset 7164 in orxonox.OLD for trunk/src/lib/event
- Timestamp:
- Feb 18, 2006, 5:32:35 PM (19 years ago)
- Location:
- trunk/src/lib/event
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/event/event_handler.cc
r6990 r7164 26 26 #include "class_list.h" 27 27 28 #include "t_stack.h"29 30 28 using namespace std; 31 29 … … 51 49 this->state = ES_GAME; 52 50 this->keyMapper = NULL; 53 this->stateStack = NULL;54 51 this->eventsGrabbed = false; 55 52 } … … 78 75 } 79 76 } 80 delete this->stateStack;81 77 delete this->keyMapper; 82 78 … … 99 95 this->keyMapper->loadKeyBindings(iniParser); 100 96 } 101 if (this->stateStack == NULL)102 this->stateStack = new tStack<short>;103 97 } 104 98 … … 109 103 void EventHandler::pushState(elState state) 110 104 { 111 if (likely(state != ES_NULL && state != ES_ALL && this->stateStack != NULL))112 { 113 this->stateStack ->push(this->state);105 if (likely(state != ES_NULL && state != ES_ALL )) 106 { 107 this->stateStack.push(this->state); 114 108 this->setState(state); 115 109 } … … 126 120 elState EventHandler::popState() 127 121 { 128 if (unlikely(this->stateStack == NULL)) 129 return ES_NULL; 130 elState state = (elState)this->stateStack->pop(); 122 elState state = (elState)stateStack.top(); 123 this->stateStack.pop(); 131 124 if (state == ES_NULL) 132 125 { -
trunk/src/lib/event/event_handler.h
r6054 r7164 11 11 #include "key_mapper.h" 12 12 #include "event_def.h" 13 #include <stack> 13 14 14 15 // FORWARD DECLARATION 15 16 class EventListener; 16 template<class T> class tStack;17 17 class IniParser; 18 18 … … 59 59 EventListener* listeners[ES_NUMBER][EV_NUMBER]; //!< a list of registered listeners. 60 60 elState state; //!< the state of the event handlder. 61 tStack<short>*stateStack; //!< a stack for the States we are in.61 std::stack<short> stateStack; //!< a stack for the States we are in. 62 62 KeyMapper* keyMapper; //!< reference to the key mapper. 63 63
Note: See TracChangeset
for help on using the changeset viewer.