Changeset 7164 in orxonox.OLD for trunk/src/lib/event/event_handler.cc
- Timestamp:
- Feb 18, 2006, 5:32:35 PM (19 years ago)
- File:
-
- 1 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 {
Note: See TracChangeset
for help on using the changeset viewer.