- Timestamp:
- Aug 24, 2005, 2:45:46 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.cc
r5115 r5118 598 598 PRINTF(4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z); 599 599 if (this->bRelCoorChanged) 600 { 601 this->prevRelCoordinate = this->relCoordinate; 600 602 this->absCoordinate = this->relCoordinate; 603 } 601 604 if (this->bRelDirChanged) 605 { 606 this->prevRelDirection = this->relDirection; 602 607 this->absDirection = this->getAbsDir () * this->relDirection; 608 } 603 609 } 604 610 -
trunk/src/lib/graphics/render2D/element_2d.cc
r5117 r5118 618 618 619 619 620 if( this->parentMode & PNODE_LOCAL_ROTATE && this->bRelDirChanged)620 if( this->parentMode & E2D_PARENT_LOCAL_ROTATE && this->bRelDirChanged) 621 621 { 622 622 /* update the current absDirection - remember * means rotation around sth.*/ … … 677 677 PRINTF(5)("Element2D::update - (%f, %f, %f)\n", this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z); 678 678 if (this->bRelCoorChanged) 679 { 680 this->prevRelCoordinate = this->relCoordinate; 679 681 this->absCoordinate = this->relCoordinate; 682 } 680 683 if (this->bRelDirChanged) 684 { 685 this->prevRelDirection = this->relDirection; 681 686 this->absDirection = this->getAbsDir2D() * this->relDirection; 687 } 682 688 } 683 689 -
trunk/src/lib/util/list.h
r5115 r5118 333 333 334 334 T* firstElement(); 335 T* lastElement(); 335 336 T* nextElement(); 337 T* prevElement(); 336 338 T* seekElement(T* element); 337 339 T* iteratorElement(const tIterator<T>* iterator); … … 375 377 inline tIterator<T>::~tIterator () 376 378 { 377 this->currentEl = NULL;378 379 } 379 380 … … 382 383 { 383 384 this->currentEl = this->list->first; 384 if (this->currentEl == NULL) 385 return NULL; 386 else 385 if (this->currentEl != NULL) 387 386 return this->currentEl->curr; 387 else 388 return NULL; 389 } 390 391 template<class T> 392 inline T* tIterator<T>::lastElement () 393 { 394 this->currentEl = this->list->last; 395 if (this->currentEl != NULL) 396 return this->currentEl->curr; 397 else 398 return NULL; 388 399 } 389 400 … … 405 416 return NULL; 406 417 } 418 419 /** 420 * use it to iterate backwards through the list 421 * @returns next list element 422 */ 423 template<class T> 424 inline T* tIterator<T>::prevElement () 425 { 426 if( this->currentEl == NULL) 427 return NULL; 428 429 this->currentEl = this->currentEl->prev; 430 if (this->currentEl != NULL) 431 return this->currentEl->curr; 432 else 433 return NULL; 434 } 435 407 436 408 437 /** -
trunk/src/util/shell.cc
r5115 r5118 45 45 this->bActive = false; 46 46 this->buffer = new tList<char>; 47 this->bufferIterator = this->buffer->getIterator(); 47 48 48 49 this->textSize = 15; … … 53 54 this->setBufferSize(100); 54 55 this->bufferDisplaySize = 10; 55 this->setBufferDisplaySize(10);56 56 this->setAbsCoor2D(3, -400); 57 57 this->delayed = 0; … … 90 90 91 91 // delete all the Chars in the Buffers 92 tIterator<char>* charIterator = this->buffer->getIterator(); 93 char* charElem = charIterator->firstElement(); 92 char* charElem = this->bufferIterator->firstElement(); 94 93 while (charElem != NULL) 95 94 { 96 95 delete charElem; 97 charElem = charIterator->nextElement();98 } 99 delete charIterator;96 charElem = this->bufferIterator->nextElement(); 97 } 98 delete this->bufferIterator; 100 99 101 100 // if (this->completionList != NULL) … … 114 113 EventHandler::getInstance()->setState(ES_SHELL); 115 114 this->setRelCoorSoft2D(0, 0, 1, 5); 115 116 this->bufferIterator->lastElement(); 117 for (int i = 0; i < this->bufferDisplaySize; i++) 118 this->bufferText[i]->setText(this->bufferIterator->prevElement()); 116 119 } 117 120 … … 124 127 EventHandler::getInstance()->setState(ES_GAME); 125 128 this->setRelCoorSoft2D(0, -400, 1, 5); 129 126 130 } 127 131 … … 249 253 } 250 254 251 if (this->bActive && likely(bufferText != NULL))255 if (this->bActive) 252 256 { 253 Text* lastText = this->bufferText[this->bufferDisplaySize-1]; 254 Vector firstCoord = this->bufferText[0]->getRelCoorSoft2D(); 255 256 Text* swapText; 257 Text* moveText = this->bufferText[0]; 258 this->bufferText[0]->setRelCoorSoft2D(this->bufferText[1]->getRelCoorSoft2D(), 5); 259 for (unsigned int i = 1; i < this->bufferDisplaySize; i++) 260 { 261 if ( i < this->bufferDisplaySize-1) 262 this->bufferText[i]->setRelCoorSoft2D(this->bufferText[i+1]->getRelCoorSoft2D(),5); 263 swapText = this->bufferText[i]; 264 this->bufferText[i] = moveText; 265 moveText = swapText; 266 } 267 lastText->setRelCoor2D(firstCoord); 268 this->bufferText[0] = lastText; 269 270 this->bufferText[0]->setText(newLine); 257 this->printToDisplayBuffer(newLine); 271 258 } 259 } 260 261 /** 262 * prints out some text to the input-buffers 263 * @param text the text to output. 264 */ 265 void Shell::printToDisplayBuffer(const char* text) 266 { 267 if(likely(bufferText != NULL)) 268 { 269 Text* lastText = this->bufferText[this->bufferDisplaySize-1]; 270 Vector firstCoord = this->bufferText[0]->getRelCoorSoft2D(); 271 272 Text* swapText; 273 Text* moveText = this->bufferText[0]; 274 this->bufferText[0]->setRelCoorSoft2D(this->bufferText[1]->getRelCoorSoft2D(), 5); 275 for (unsigned int i = 1; i < this->bufferDisplaySize; i++) 276 { 277 if ( i < this->bufferDisplaySize-1) 278 this->bufferText[i]->setRelCoorSoft2D(this->bufferText[i+1]->getRelCoorSoft2D(),5); 279 swapText = this->bufferText[i]; 280 this ->bufferText[i] = moveText; 281 moveText = swapText; 282 } 283 lastText->setRelCoor2D(firstCoord); 284 this->bufferText[0] = lastText; 285 286 this->bufferText[0]->setText(text); 287 } 272 288 } 273 289 -
trunk/src/util/shell.h
r5113 r5118 15 15 class Text; 16 16 template<class T> class tList; 17 template<class T> class tIterator; 17 18 18 19 //! A class that is able to redirect all output to a openGL-Shell, and that one can use to input some commands … … 48 49 static bool addBufferLineStatic(const char* line, ...); 49 50 void addBufferLine(const char* line, va_list arg); 51 void printToDisplayBuffer(const char* text); 50 52 void moveBuffer(int lineCount); 51 53 const char* getBufferLine(unsigned int lineNumber); … … 96 98 97 99 tList<char>* buffer; //!< A list of stored char-arrays(strings) to store the history 100 tIterator<char>* bufferIterator; //!< An iterator for the Shells main buffer. 98 101 99 102 Text** bufferText; //!< A list of stored bufferTexts for the display of the buffer
Note: See TracChangeset
for help on using the changeset viewer.