Changeset 5075 in orxonox.OLD for trunk/src/util/shell.cc
- Timestamp:
- Aug 19, 2005, 3:21:27 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/shell.cc
r5074 r5075 21 21 #include "list.h" 22 22 23 #include <stdarg.h> 24 #include <stdio.h> 25 23 26 using namespace std; 24 27 … … 41 44 42 45 43 this->addBufferLine("asjflksjdvklasmv", NULL);44 TextEngine::getInstance()->debug();46 //this->addBufferLineStatic("asjflksjdvklasmv %s", "doom"); 47 //TextEngine::getInstance()->debug(); 45 48 //exit(-1); 46 49 } … … 73 76 while(bufferDisplaySize > this->bufferText->getSize()) 74 77 { 75 Text* newText = TextEngine::getInstance()->createText("fonts/earth.ttf", 30, TEXT_DYNAMIC, 0, 255, 0);78 Text* newText = TextEngine::getInstance()->createText("fonts/earth.ttf", 10, TEXT_DYNAMIC, 0, 255, 0); 76 79 newText->setAlignment(TEXT_ALIGN_LEFT); 77 80 newText->setPosition2D(5, 5); … … 120 123 * @todo optimize 121 124 */ 122 void Shell::addBufferLine(const char* line, va_list args) 123 { 124 char tmp[1024];// = new char* 125 vsprintf(tmp, line, args); 126 127 char* newLine = new char[strlen(tmp)+1]; 128 strcpy(newLine, tmp); 129 130 this->buffer->addAtBeginning(newLine); 131 132 if (this->buffer->getSize() > this->bufferSize) 133 { 134 delete this->buffer->firstElement(); 135 this->buffer->remove(this->buffer->firstElement()); 136 } 125 bool Shell::addBufferLineStatic(const char* line, ...) 126 { 127 va_list arguments; 128 va_start(arguments, line); 129 130 if (Shell::singletonRef == NULL) 131 vprintf(line, arguments); 132 else 133 Shell::singletonRef->addBufferLine(line, arguments); 134 return true; 135 } 136 137 void Shell::addBufferLine(const char* line, va_list arguments) 138 { 139 vsprintf(this->bufferArray, line, arguments); 140 141 char* newLine = new char[strlen(this->bufferArray)+1]; 142 strcpy(newLine, this->bufferArray); 143 144 // this->buffer->add(newLine); 145 146 // if (this->buffer->getSize() > this->bufferSize) 147 // { 148 // delete this->buffer->firstElement(); 149 // this->buffer->remove(this->buffer->firstElement()); 150 // } 137 151 138 152 this->bufferText->firstElement()->setText(newLine); 139 140 153 } 141 154
Note: See TracChangeset
for help on using the changeset viewer.