Changeset 8797
- Timestamp:
- Jul 30, 2011, 10:39:33 AM (13 years ago)
- Location:
- code/branches/output/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/core/command/IOConsolePOSIX.cc
r8795 r8797 391 391 } 392 392 393 //! Called if only the last output-line has changed394 void IOConsole::onlyLastLineChanged()395 {396 // Save cursor position and move it to the beginning of the first output line397 this->cout_ << "\033[s\033[1A\033[1G";398 // Erase the line399 this->cout_ << "\033[K";400 // Reprint the last output line401 this->printOutputLine(this->shell_->getNewestLineIterator()->first, this->shell_->getNewestLineIterator()->second);402 // Restore cursor403 this->cout_ << "\033[u";404 this->cout_.flush();405 }406 407 393 //! Called if a new output-line was added 408 394 void IOConsole::lineAdded() -
code/branches/output/src/libraries/core/command/IOConsolePOSIX.h
r7401 r8797 66 66 // Methods from ShellListener 67 67 void linesChanged(); 68 void onlyLastLineChanged();69 68 void lineAdded(); 70 69 void inputChanged(); -
code/branches/output/src/libraries/core/command/IOConsoleWindows.cc
r8795 r8797 388 388 } 389 389 390 //! Called if only the last output-line has changed391 void IOConsole::onlyLastLineChanged()392 {393 int newLineHeight = 1 + this->shell_->getNewestLineIterator()->first.size() / this->terminalWidth_;394 // Compute the number of new lines needed395 int newLines = newLineHeight - this->lastOutputLineHeight_;396 this->lastOutputLineHeight_ = newLineHeight;397 // Scroll console if necessary398 if (newLines > 0) // newLines < 0 is assumed impossible399 this->createNewOutputLines(newLines);400 Shell::LineList::const_iterator it = this->shell_->getNewestLineIterator();401 this->printOutputLine(it->first, it->second, makeCOORD(0, this->inputLineRow_ - newLineHeight));402 }403 404 390 //! Called if a new output line was added 405 391 void IOConsole::lineAdded() -
code/branches/output/src/libraries/core/command/IOConsoleWindows.h
r8729 r8797 68 68 // Methods from ShellListener 69 69 void linesChanged(); 70 void onlyLastLineChanged();71 70 void lineAdded(); 72 71 void inputChanged(); -
code/branches/output/src/libraries/core/command/Shell.h
r8795 r8797 66 66 private: 67 67 virtual void linesChanged() {} ///< Called if all output-lines have changed 68 virtual void onlyLastLineChanged() {} ///< Called if only the last output-line has changed69 68 virtual void lineAdded() {} ///< Called if a new line was added to the output 70 69 virtual void inputChanged() {} ///< Called if the input has changed -
code/branches/output/src/orxonox/overlays/InGameConsole.cc
r8795 r8797 299 299 300 300 /** 301 @brief Called if only the last output-line has changed. 302 */ 303 void InGameConsole::onlyLastLineChanged() 304 { 301 @brief Called if a new output-line was added. 302 */ 303 void InGameConsole::lineAdded() 304 { 305 this->numLinesShifted_ = 0; 306 this->shiftLines(); 305 307 if (LINES > 1) 306 308 this->print(this->shell_->getNewestLineIterator()->first, this->shell_->getNewestLineIterator()->second, 1); 307 }308 309 /**310 @brief Called if a new output-line was added.311 */312 void InGameConsole::lineAdded()313 {314 this->numLinesShifted_ = 0;315 this->shiftLines();316 this->onlyLastLineChanged();317 309 } 318 310 -
code/branches/output/src/orxonox/overlays/InGameConsole.h
r7284 r8797 64 64 65 65 void linesChanged(); 66 void onlyLastLineChanged();67 66 void lineAdded(); 68 67 void inputChanged();
Note: See TracChangeset
for help on using the changeset viewer.