Changeset 7164 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Feb 18, 2006, 5:32:35 PM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/Makefile.am
r7163 r7164 19 19 lang/class_list.h \ 20 20 util/substring.h \ 21 util/array.h \ 22 util/list.h \ 23 util/t_stack.h \ 21 util/multi_type.h \ 24 22 util/color.h \ 25 23 util/helper_functions.h \ 26 util/multi_type.h \27 24 util/executor/executor.h \ 28 25 util/executor/executor_specials.h \ 29 26 util/executor/functor_list.h \ 30 27 util/count_pointer.h \ 28 util/list.h \ 31 29 coord/p_node.h \ 32 30 data/data_tank.h \ -
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 -
trunk/src/lib/graphics/shader.cc
r6645 r7164 22 22 #include <stdio.h> 23 23 #include "debug.h" 24 #include "array.h"25 24 26 25 #include "resource_manager.h" … … 126 125 127 126 128 tArray<char*>* program = fileReadArray(fileName); 129 if (program == NULL) 130 return false; 127 std::vector<char*>* program = fileReadArray(fileName); 131 128 132 129 if (type == SHADER_VERTEX && GLEW_ARB_vertex_shader) … … 149 146 { 150 147 GLint status = 0; 151 glShaderSourceARB(shader, program-> getCount(), (const char**)program->getArray(), NULL);148 glShaderSourceARB(shader, program->size(), (const char**)&(*program)[0], NULL); 152 149 glCompileShaderARB(shader); 153 150 // checking on error. … … 158 155 glAttachObjectARB(this->shaderProgram, shader); 159 156 } 160 for (unsigned int i=0; i< program-> getCount(); i++)161 delete[] program->getArray()[i];157 for (unsigned int i=0; i< program->size(); i++) 158 delete[] (*program)[i]; 162 159 delete program; 163 160 } … … 190 187 191 188 192 tArray<char*>* Shader::fileReadArray(const char* fileName)189 std::vector<char*>* Shader::fileReadArray(const char* fileName) 193 190 { 194 191 FILE* stream; //< The stream we use to read the file. … … 199 196 return NULL; 200 197 } 201 tArray<char*>* file = new tArray<char*>;198 std::vector<char*>* file = new std::vector<char*>; 202 199 203 200 char lineBuffer[PARSELINELENGHT]; … … 207 204 addString = new char[strlen(lineBuffer)+1]; 208 205 strcpy(addString, lineBuffer); 209 file-> addEntry(addString);206 file->push_back(addString); 210 207 } 211 208 fclose(stream); 212 file->finalizeArray();213 209 return file; 214 210 } -
trunk/src/lib/graphics/shader.h
r5390 r7164 9 9 #include "base_object.h" 10 10 #include "glincl.h" 11 #include <vector> 11 12 12 template<class T> class tArray;13 13 14 14 typedef enum … … 38 38 39 39 char* fileRead(const char* fileName); 40 tArray<char*>* fileReadArray(const char* fileName);40 std::vector<char*>* fileReadArray(const char* fileName); 41 41 42 42 static bool checkShaderAbility(); -
trunk/src/lib/lang/class_list.cc
r7163 r7164 182 182 ClassList* ClassList::getClassList(ClassID classID) 183 183 { 184 std::vector<ClassList>::iterator classIT = std::find (ClassList::classList->begin(), ClassList::classList->end(), classID); 184 std::vector<ClassList>::iterator classIT = 185 std::find (ClassList::classList->begin(), ClassList::classList->end(), classID); 185 186 return (likely(classIT != classList->end()))? &(*classIT) : NULL; 186 187 }
Note: See TracChangeset
for help on using the changeset viewer.