Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8797 for code


Ignore:
Timestamp:
Jul 30, 2011, 10:39:33 AM (13 years ago)
Author:
landauf
Message:

removed onlyLastLineChanged() callback from ShellListener, since it's not possible to print a line of output word by word anymore, instead only whole lines are printed.

Location:
code/branches/output/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/core/command/IOConsolePOSIX.cc

    r8795 r8797  
    391391    }
    392392
    393     //! Called if only the last output-line has changed
    394     void IOConsole::onlyLastLineChanged()
    395     {
    396         // Save cursor position and move it to the beginning of the first output line
    397         this->cout_ << "\033[s\033[1A\033[1G";
    398         // Erase the line
    399         this->cout_ << "\033[K";
    400         // Reprint the last output line
    401         this->printOutputLine(this->shell_->getNewestLineIterator()->first, this->shell_->getNewestLineIterator()->second);
    402         // Restore cursor
    403         this->cout_ << "\033[u";
    404         this->cout_.flush();
    405     }
    406 
    407393    //! Called if a new output-line was added
    408394    void IOConsole::lineAdded()
  • code/branches/output/src/libraries/core/command/IOConsolePOSIX.h

    r7401 r8797  
    6666        // Methods from ShellListener
    6767        void linesChanged();
    68         void onlyLastLineChanged();
    6968        void lineAdded();
    7069        void inputChanged();
  • code/branches/output/src/libraries/core/command/IOConsoleWindows.cc

    r8795 r8797  
    388388    }
    389389
    390     //! Called if only the last output-line has changed
    391     void IOConsole::onlyLastLineChanged()
    392     {
    393         int newLineHeight = 1 + this->shell_->getNewestLineIterator()->first.size() / this->terminalWidth_;
    394         // Compute the number of new lines needed
    395         int newLines = newLineHeight - this->lastOutputLineHeight_;
    396         this->lastOutputLineHeight_ = newLineHeight;
    397         // Scroll console if necessary
    398         if (newLines > 0) // newLines < 0 is assumed impossible
    399             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 
    404390    //! Called if a new output line was added
    405391    void IOConsole::lineAdded()
  • code/branches/output/src/libraries/core/command/IOConsoleWindows.h

    r8729 r8797  
    6868        // Methods from ShellListener
    6969        void linesChanged();
    70         void onlyLastLineChanged();
    7170        void lineAdded();
    7271        void inputChanged();
  • code/branches/output/src/libraries/core/command/Shell.h

    r8795 r8797  
    6666        private:
    6767            virtual void linesChanged() {}          ///< Called if all output-lines have changed
    68             virtual void onlyLastLineChanged() {}   ///< Called if only the last output-line has changed
    6968            virtual void lineAdded() {}             ///< Called if a new line was added to the output
    7069            virtual void inputChanged() {}          ///< Called if the input has changed
  • code/branches/output/src/orxonox/overlays/InGameConsole.cc

    r8795 r8797  
    299299
    300300    /**
    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();
    305307        if (LINES > 1)
    306308            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();
    317309    }
    318310
  • code/branches/output/src/orxonox/overlays/InGameConsole.h

    r7284 r8797  
    6464
    6565        void linesChanged();
    66         void onlyLastLineChanged();
    6766        void lineAdded();
    6867        void inputChanged();
Note: See TracChangeset for help on using the changeset viewer.