Changeset 5129 in orxonox.OLD for trunk/src/util/shell.cc
- Timestamp:
- Aug 25, 2005, 10:52:11 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/shell.cc
r5128 r5129 17 17 18 18 #include "shell.h" 19 #include "shell_command.h" 19 20 20 21 #include "text_engine.h" … … 22 23 #include "graphics_engine.h" 23 24 #include "event_handler.h" 24 25 #include "load_param.h" 25 #include "debug.h" 26 26 #include "class_list.h" 27 27 28 28 #include "key_names.h" 29 #include "debug.h"30 29 #include <stdarg.h> 31 30 #include <stdio.h> … … 48 47 this->buffer = new tList<char>; 49 48 this->bufferIterator = this->buffer->getIterator(); 49 50 this->inputHistory = new tList<char>; 51 //this->commandList = new tList<ShellCommand>; 50 52 51 53 this->textSize = 15; … … 73 75 for (int i = 1; i < SDLK_LAST; i++) 74 76 evh->subscribe(this, ES_SHELL, i); 77 78 79 // this->registerCommand("clear", Shell::) 75 80 } 76 81 … … 105 110 Shell::singletonRef = NULL; 106 111 } 107 108 112 109 113 /** … … 448 452 this->addBufferLineStatic("Execute Command: %s\n", this->inputLine); 449 453 454 char* newCommand = new char[strlen(this->inputLine)+1]; 455 strcpy(newCommand, this->inputLine); 456 this->inputHistory->add(newCommand); 457 450 458 if (!strcmp(this->inputLine, "clear")) 451 459 { … … 501 509 else if (event.type == SDLK_RETURN) 502 510 this->executeCommand(); 511 /* 512 else if (event.type == SDLK_UP) 513 { 514 // this->flushInputLine(); 515 tIterator<char>* iterator = this->commandList->getIterator(); 516 char* command = iterator->lastElement(); 517 while (command) 518 { 519 if (!strcmp (command, inputLine)) 520 { 521 inputLine = iterator->prevElement(); 522 return; 523 } 524 command = iterator->prevElement(); 525 } 526 inputLine = iterator->lastElement(); 527 } 528 */ 503 529 else if (likely(event.type < 127)) 504 530 {
Note: See TracChangeset
for help on using the changeset viewer.