[Orxonox-commit 4126] r8797 - in code/branches/output/src: libraries/core/command orxonox/overlays

landauf at orxonox.net landauf at orxonox.net
Sat Jul 30 10:39:33 CEST 2011


Author: landauf
Date: 2011-07-30 10:39:33 +0200 (Sat, 30 Jul 2011)
New Revision: 8797

Modified:
   code/branches/output/src/libraries/core/command/IOConsolePOSIX.cc
   code/branches/output/src/libraries/core/command/IOConsolePOSIX.h
   code/branches/output/src/libraries/core/command/IOConsoleWindows.cc
   code/branches/output/src/libraries/core/command/IOConsoleWindows.h
   code/branches/output/src/libraries/core/command/Shell.h
   code/branches/output/src/orxonox/overlays/InGameConsole.cc
   code/branches/output/src/orxonox/overlays/InGameConsole.h
Log:
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.

Modified: code/branches/output/src/libraries/core/command/IOConsolePOSIX.cc
===================================================================
--- code/branches/output/src/libraries/core/command/IOConsolePOSIX.cc	2011-07-29 22:54:55 UTC (rev 8796)
+++ code/branches/output/src/libraries/core/command/IOConsolePOSIX.cc	2011-07-30 08:39:33 UTC (rev 8797)
@@ -390,20 +390,6 @@
         // Exit is not an option, just do nothing (Shell doesn't really exit too)
     }
 
-    //! Called if only the last output-line has changed
-    void IOConsole::onlyLastLineChanged()
-    {
-        // Save cursor position and move it to the beginning of the first output line
-        this->cout_ << "\033[s\033[1A\033[1G";
-        // Erase the line
-        this->cout_ << "\033[K";
-        // Reprint the last output line
-        this->printOutputLine(this->shell_->getNewestLineIterator()->first, this->shell_->getNewestLineIterator()->second);
-        // Restore cursor
-        this->cout_ << "\033[u";
-        this->cout_.flush();
-    }
-
     //! Called if a new output-line was added
     void IOConsole::lineAdded()
     {

Modified: code/branches/output/src/libraries/core/command/IOConsolePOSIX.h
===================================================================
--- code/branches/output/src/libraries/core/command/IOConsolePOSIX.h	2011-07-29 22:54:55 UTC (rev 8796)
+++ code/branches/output/src/libraries/core/command/IOConsolePOSIX.h	2011-07-30 08:39:33 UTC (rev 8797)
@@ -65,7 +65,6 @@
 
         // Methods from ShellListener
         void linesChanged();
-        void onlyLastLineChanged();
         void lineAdded();
         void inputChanged();
         void cursorChanged();

Modified: code/branches/output/src/libraries/core/command/IOConsoleWindows.cc
===================================================================
--- code/branches/output/src/libraries/core/command/IOConsoleWindows.cc	2011-07-29 22:54:55 UTC (rev 8796)
+++ code/branches/output/src/libraries/core/command/IOConsoleWindows.cc	2011-07-30 08:39:33 UTC (rev 8797)
@@ -387,20 +387,6 @@
         SetConsoleCursorPosition(stdOutHandle_, pos);
     }
 
-    //! Called if only the last output-line has changed
-    void IOConsole::onlyLastLineChanged()
-    {
-        int newLineHeight = 1 + this->shell_->getNewestLineIterator()->first.size() / this->terminalWidth_;
-        // Compute the number of new lines needed
-        int newLines = newLineHeight - this->lastOutputLineHeight_;
-        this->lastOutputLineHeight_ = newLineHeight;
-        // Scroll console if necessary
-        if (newLines > 0) // newLines < 0 is assumed impossible
-            this->createNewOutputLines(newLines);
-        Shell::LineList::const_iterator it = this->shell_->getNewestLineIterator();
-        this->printOutputLine(it->first, it->second, makeCOORD(0, this->inputLineRow_ - newLineHeight));
-    }
-
     //! Called if a new output line was added
     void IOConsole::lineAdded()
     {

Modified: code/branches/output/src/libraries/core/command/IOConsoleWindows.h
===================================================================
--- code/branches/output/src/libraries/core/command/IOConsoleWindows.h	2011-07-29 22:54:55 UTC (rev 8796)
+++ code/branches/output/src/libraries/core/command/IOConsoleWindows.h	2011-07-30 08:39:33 UTC (rev 8797)
@@ -67,7 +67,6 @@
 
         // Methods from ShellListener
         void linesChanged();
-        void onlyLastLineChanged();
         void lineAdded();
         void inputChanged();
         void cursorChanged();

Modified: code/branches/output/src/libraries/core/command/Shell.h
===================================================================
--- code/branches/output/src/libraries/core/command/Shell.h	2011-07-29 22:54:55 UTC (rev 8796)
+++ code/branches/output/src/libraries/core/command/Shell.h	2011-07-30 08:39:33 UTC (rev 8797)
@@ -65,7 +65,6 @@
 
         private:
             virtual void linesChanged() {}          ///< Called if all output-lines have changed
-            virtual void onlyLastLineChanged() {}   ///< Called if only the last output-line has changed
             virtual void lineAdded() {}             ///< Called if a new line was added to the output
             virtual void inputChanged() {}          ///< Called if the input has changed
             virtual void cursorChanged() {}         ///< Called if the cursor in the input line has changed

Modified: code/branches/output/src/orxonox/overlays/InGameConsole.cc
===================================================================
--- code/branches/output/src/orxonox/overlays/InGameConsole.cc	2011-07-29 22:54:55 UTC (rev 8796)
+++ code/branches/output/src/orxonox/overlays/InGameConsole.cc	2011-07-30 08:39:33 UTC (rev 8797)
@@ -298,22 +298,14 @@
     }
 
     /**
-        @brief Called if only the last output-line has changed.
-    */
-    void InGameConsole::onlyLastLineChanged()
-    {
-        if (LINES > 1)
-            this->print(this->shell_->getNewestLineIterator()->first, this->shell_->getNewestLineIterator()->second, 1);
-    }
-
-    /**
         @brief Called if a new output-line was added.
     */
     void InGameConsole::lineAdded()
     {
         this->numLinesShifted_ = 0;
         this->shiftLines();
-        this->onlyLastLineChanged();
+        if (LINES > 1)
+            this->print(this->shell_->getNewestLineIterator()->first, this->shell_->getNewestLineIterator()->second, 1);
     }
 
     /**

Modified: code/branches/output/src/orxonox/overlays/InGameConsole.h
===================================================================
--- code/branches/output/src/orxonox/overlays/InGameConsole.h	2011-07-29 22:54:55 UTC (rev 8796)
+++ code/branches/output/src/orxonox/overlays/InGameConsole.h	2011-07-30 08:39:33 UTC (rev 8797)
@@ -63,7 +63,6 @@
         void deactivate();
 
         void linesChanged();
-        void onlyLastLineChanged();
         void lineAdded();
         void inputChanged();
         void cursorChanged();




More information about the Orxonox-commit mailing list