Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5787 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Nov 26, 2005, 10:18:28 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: safer shell, better key-handling

Location:
trunk/src/lib/shell
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell.cc

    r5786 r5787  
    133133  this->setRelCoorSoft2D(0, 0, 1, 5);
    134134
    135   list<char*>::const_reverse_iterator textLine = ShellBuffer::getInstance()->getBuffer()->rbegin();
     135  list<char*>::const_iterator textLine = --ShellBuffer::getInstance()->getBuffer()->end();
     136  bool top = false;
    136137  for (int i = 0; i < this->bufferDisplaySize; i++)
    137138  {
    138     this->bufferText[i]->setText((*textLine), true);
    139139    this->bufferText[i]->setVisibility(true);
    140     textLine--;
     140    if (!top)
     141    {
     142      this->bufferText[i]->setText((*textLine), true);
     143    if (textLine != ShellBuffer::getInstance()->getBuffer()->begin())
     144      top = true;
     145      textLine--;
     146    }
    141147  }
    142148}
     
    156162  this->setRelCoorSoft2D(0, -(int)this->shellHeight, 1, 5);
    157163
    158   list<char*>::const_reverse_iterator textLine = ShellBuffer::getInstance()->getBuffer()->rbegin();
     164  list<char*>::const_iterator textLine = --ShellBuffer::getInstance()->getBuffer()->end();
    159165  for (int i = 0; i < this->bufferDisplaySize; i++)
    160166  {
    161     this->bufferText[i]->setText((*textLine), false);
    162167    this->bufferText[i]->setVisibility(false);
    163     textLine--;
     168    if (textLine != ShellBuffer::getInstance()->getBuffer()->begin())
     169    {
     170      this->bufferText[i]->setText((*textLine), false);
     171      textLine--;
     172    }
    164173  }
    165174  this->bufferOffset = 0;
     
    304313  }
    305314
    306   list<char*>::const_reverse_iterator textLine = ShellBuffer::getInstance()->getBuffer()->rbegin();
     315  list<char*>::const_iterator textLine = --ShellBuffer::getInstance()->getBuffer()->end();
    307316  bufferText = new Text*[bufferDisplaySize];
    308317  for (unsigned int i = 0; i < bufferDisplaySize; i++)
     
    310319    bufferText[i] = new Text(this->fontFile, this->textSize);
    311320    bufferText[i]->setAlignment(TEXT_ALIGN_LEFT);
    312     bufferText[i]->setText(*textLine);
    313321    bufferText[i]->setParent2D(this);
    314     textLine--;
     322    if(textLine != ShellBuffer::getInstance()->getBuffer()->begin())
     323    {
     324      bufferText[i]->setText(*textLine);
     325      textLine--;
     326    }
    315327  }
    316328  this->bufferDisplaySize = bufferDisplaySize;
  • trunk/src/lib/shell/shell_input.cc

    r5786 r5787  
    385385  else // if(!event.bPressed)
    386386  {
    387     if (this->pressedKey == event.x)
     387    if (this->pressedKey == event.x || this->pressedKey == event.type)
    388388    {
    389389      this->pressedKey = 0;
Note: See TracChangeset for help on using the changeset viewer.