Changeset 7216 in orxonox.OLD for branches/std/src/lib/shell/shell.cc
- Timestamp:
- Mar 12, 2006, 8:54:30 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/lib/shell/shell.cc
r7198 r7216 85 85 this->lineSpacing = 0; 86 86 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; 89 88 90 89 … … 110 109 delete this->bufferText[i]; 111 110 delete[] this->bufferText; 112 delete[] this->fontFile;113 111 // delete the inputLine 114 112 delete this->shellInput; … … 139 137 if (!top) 140 138 { 141 this->bufferText[i]->setText((*textLine) , true);139 this->bufferText[i]->setText((*textLine)); 142 140 if (textLine != ShellBuffer::getInstance()->getBuffer()->begin()) 143 141 top = true; … … 167 165 if (textLine != ShellBuffer::getInstance()->getBuffer()->begin()) 168 166 { 169 this->bufferText[i]->setText((*textLine) , false);167 this->bufferText[i]->setText((*textLine)); 170 168 textLine--; 171 169 } … … 181 179 * (be aware that within orxonox fontFile is relative to the Data-Dir) 182 180 */ 183 void Shell::setFont(const char*fontFile)181 void Shell::setFont(const std::string& fontFile) 184 182 { 185 183 // if (!ResourceManager::isInDataDir(fontFile)) 186 184 // return false; 187 185 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; 193 187 194 188 this->rebuildText(); … … 245 239 * @param fileName the filename of the Image to load 246 240 */ 247 void Shell::setBackgroundImage(const char*fileName)241 void Shell::setBackgroundImage(const std::string& fileName) 248 242 { 249 243 this->backgroundMaterial->setDiffuseMap(fileName); … … 340 334 for (int i = 0; i < this->bufferDisplaySize; i++) 341 335 { 342 this->bufferText[i]->setText( NULL, true);336 this->bufferText[i]->setText(""); 343 337 } 344 338 … … 351 345 * @param text the text to output. 352 346 */ 353 void Shell::printToDisplayBuffer(const char*text)347 void Shell::printToDisplayBuffer(const std::string& text) 354 348 { 355 349 if(likely(bufferText != NULL)) … … 382 376 this->bufferText[0] = lastText; 383 377 384 this->bufferText[0]->setText(text , true);378 this->bufferText[0]->setText(text); 385 379 } 386 380 } … … 427 421 for (unsigned int i = 0; i < this->bufferDisplaySize; i++) 428 422 { 429 this->bufferText[i]->setText((*it) , false);423 this->bufferText[i]->setText((*it)); 430 424 it--; 431 425 }
Note: See TracChangeset
for help on using the changeset viewer.