Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7216 in orxonox.OLD for branches/std/src/lib/shell/shell.cc


Ignore:
Timestamp:
Mar 12, 2006, 8:54:30 AM (19 years ago)
Author:
bensch
Message:

orxonox/std:: compile and run again, with many more std::strings….

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/lib/shell/shell.cc

    r7198 r7216  
    8585  this->lineSpacing = 0;
    8686  this->bActive = true;
    87   this->fontFile = new char[strlen(SHELL_DEFAULT_FONT)+1];
    88   strcpy(this->fontFile, SHELL_DEFAULT_FONT);
     87  this->fontFile = SHELL_DEFAULT_FONT;
    8988
    9089
     
    110109    delete this->bufferText[i];
    111110  delete[] this->bufferText;
    112   delete[] this->fontFile;
    113111  // delete the inputLine
    114112  delete this->shellInput;
     
    139137    if (!top)
    140138    {
    141       this->bufferText[i]->setText((*textLine), true);
     139      this->bufferText[i]->setText((*textLine));
    142140    if (textLine != ShellBuffer::getInstance()->getBuffer()->begin())
    143141      top = true;
     
    167165    if (textLine != ShellBuffer::getInstance()->getBuffer()->begin())
    168166    {
    169       this->bufferText[i]->setText((*textLine), false);
     167      this->bufferText[i]->setText((*textLine));
    170168      textLine--;
    171169    }
     
    181179 * (be aware that within orxonox fontFile is relative to the Data-Dir)
    182180 */
    183 void Shell::setFont(const char* fontFile)
     181void Shell::setFont(const std::string& fontFile)
    184182{
    185183//   if (!ResourceManager::isInDataDir(fontFile))
    186184//     return false;
    187185
    188   if (this->fontFile != NULL)
    189     delete[] this->fontFile;
    190 
    191   this->fontFile = new char[strlen(fontFile)+1];
    192   strcpy(this->fontFile, fontFile);
     186  this->fontFile = fontFile;
    193187
    194188  this->rebuildText();
     
    245239 * @param fileName the filename of the Image to load
    246240 */
    247 void Shell::setBackgroundImage(const char* fileName)
     241void Shell::setBackgroundImage(const std::string& fileName)
    248242{
    249243  this->backgroundMaterial->setDiffuseMap(fileName);
     
    340334    for (int i = 0; i < this->bufferDisplaySize; i++)
    341335    {
    342       this->bufferText[i]->setText(NULL, true);
     336      this->bufferText[i]->setText("");
    343337    }
    344338
     
    351345 * @param text the text to output.
    352346 */
    353 void Shell::printToDisplayBuffer(const char* text)
     347void Shell::printToDisplayBuffer(const std::string& text)
    354348{
    355349  if(likely(bufferText != NULL))
     
    382376    this->bufferText[0] = lastText;
    383377
    384     this->bufferText[0]->setText(text, true);
     378    this->bufferText[0]->setText(text);
    385379  }
    386380}
     
    427421  for (unsigned int i = 0; i < this->bufferDisplaySize; i++)
    428422  {
    429     this->bufferText[i]->setText((*it), false);
     423    this->bufferText[i]->setText((*it));
    430424    it--;
    431425  }
Note: See TracChangeset for help on using the changeset viewer.