Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5120 in orxonox.OLD


Ignore:
Timestamp:
Aug 25, 2005, 12:08:04 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: better calculation of the Line-Positions in the Shell

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/collision_detection/bounding_volume.cc

    r5116 r5120  
    3030   this->center = new Vector();
    3131   this->bOrigVertices = true;
     32   this->vertices = NULL;
    3233}
    3334
     
    4344
    4445  if( this->vertices && !this->bOrigVertices)
    45   {
    46     delete this->vertices;
    47     this->vertices = NULL;
    48   }
     46    delete[] this->vertices;
    4947}
  • trunk/src/lib/collision_detection/obb.cc

    r5116 r5120  
    3232   this->halfLength = new float[3];
    3333   this->bCollided = false;
    34    this->vertices = NULL;
    3534}
    3635
  • trunk/src/lib/util/list.h

    r5118 r5120  
    465465 * grabs the iterator entity from another iterator
    466466 * @param iterator the iterator to grab the local currentEl from
    467  * @returns the grabbed element (current).
     467 * @returns the grabbed element (current). NULL if not found, or not defined
     468 *
     469 * Both iterators must be from the same List!
    468470 */
    469471template<class T>
    470472    T* tIterator<T>::iteratorElement(const tIterator<T>* iterator)
    471473{
    472   if (iterator != NULL)
     474  if (iterator != NULL && iterator->list == this->list)
    473475  {
    474476    this->currentEl = iterator->currentEl;
  • trunk/src/util/shell.cc

    r5119 r5120  
    185185    this->bufferText[i] = TextEngine::getInstance()->createText("fonts/Aniron_Bold.ttf", this->textSize, TEXT_DYNAMIC, 255, 0, 0);
    186186    this->bufferText[i]->setAlignment(TEXT_ALIGN_LEFT);
    187     this->bufferText[i]->setRelCoor2D(5, (this->textSize + this->lineSpacing)*(bufferDisplaySize - i -1));
     187    this->bufferText[i]->setRelCoor2D(calculateLinePosition(i));
    188188    this->bufferText[i]->setText(NULL);
    189189    this->bufferText[i]->setParent2D(this);
     
    282282  {
    283283    Text* lastText = this->bufferText[this->bufferDisplaySize-1];
    284     Vector firstCoord = this->bufferText[0]->getRelCoorSoft2D();
    285284
    286285    Text* swapText;
    287286    Text* moveText = this->bufferText[0];
    288     this->bufferText[0]->setRelCoorSoft2D(this->bufferText[1]->getRelCoorSoft2D(), 5);
     287    this->bufferText[0]->setRelCoorSoft2D(this->calculateLinePosition(1),10);
    289288    for (unsigned int i = 1; i < this->bufferDisplaySize; i++)
    290289    {
    291290      if ( i < this->bufferDisplaySize-1)
    292         this->bufferText[i]->setRelCoorSoft2D(this->bufferText[i+1]->getRelCoorSoft2D(),5);
     291        this->bufferText[i]->setRelCoorSoft2D(this->calculateLinePosition(i+1),5);
    293292      swapText = this->bufferText[i];
    294293      this  ->bufferText[i] = moveText;
    295294      moveText = swapText;
    296295    }
    297     lastText->setRelCoor2D(firstCoord);
     296    lastText->setRelCoor2D(this->calculateLinePosition(0));
    298297    this->bufferText[0] = lastText;
    299298
     
    739738}
    740739
     740
     741///////////////////////
     742// HELPER FUNCTIONS  //
     743///////////////////////
     744Vector Shell::calculateLinePosition(unsigned int lineNumber)
     745{
     746  return Vector(5, (this->textSize + this->lineSpacing)*(this->bufferDisplaySize - lineNumber -1), 0);
     747}
     748
     749
     750
    741751/**
    742752 * displays some nice output from the Shell
  • trunk/src/util/shell.h

    r5119 r5120  
    8383    const tList<const char>* Shell::createCompleteList(const tList<BaseObject>* inputList, const char* classNameBegin);
    8484
     85    // helpers //
     86    Vector calculateLinePosition(unsigned int lineNumber);
     87
    8588
    8689  private:
Note: See TracChangeset for help on using the changeset viewer.