Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6172


Ignore:
Timestamp:
Nov 27, 2009, 12:42:38 PM (15 years ago)
Author:
scheusso
Message:

actually i think it's nicer this way ;)

Location:
code/branches/presentation2/src/libraries/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/core/IOConsole.cc

    r6171 r6172  
    117117namespace orxonox
    118118{
    119     termios* IOConsole::originalTerminalSettings_s = 0;
    120    
    121119    namespace EscapeMode
    122120    {
     
    135133        , bStatusPrinted_(false)
    136134        , promptString_("orxonox # ")
     135        , originalTerminalSettings_(0)
    137136    {
    138137        this->setTerminalMode();
     
    369368    {
    370369        termios new_settings;
    371         IOConsole::originalTerminalSettings_s = new termios();
    372 
    373         tcgetattr(0, this->originalTerminalSettings_s);
    374         new_settings = *this->originalTerminalSettings_s;
     370        this->originalTerminalSettings_ = new termios();
     371
     372        tcgetattr(0, this->originalTerminalSettings_);
     373        new_settings = *this->originalTerminalSettings_;
    375374        new_settings.c_lflag &= ~(ICANON | ECHO);
    376375        //new_settings.c_lflag |= (ISIG | IEXTEN);
     
    383382    /*static*/ void IOConsole::resetTerminalMode()
    384383    {
    385         if(IOConsole::originalTerminalSettings_s)
    386         {
    387             tcsetattr(0, TCSANOW, IOConsole::originalTerminalSettings_s);
    388             delete IOConsole::originalTerminalSettings_s;
    389             IOConsole::originalTerminalSettings_s = 0;
     384        if(IOConsole::singletonPtr_s && IOConsole::singletonPtr_s->originalTerminalSettings_)
     385        {
     386            tcsetattr(0, TCSANOW, IOConsole::singletonPtr_s->originalTerminalSettings_);
     387            delete IOConsole::singletonPtr_s->originalTerminalSettings_;
     388            IOConsole::singletonPtr_s->originalTerminalSettings_ = 0;
    390389        }
    391390    }
  • code/branches/presentation2/src/libraries/core/IOConsole.h

    r6171 r6172  
    9393
    9494#ifdef ORXONOX_PLATFORM_UNIX
    95         static termios*         originalTerminalSettings_s;
     95        termios*         originalTerminalSettings_;
    9696#elif defined(ORXONOX_PLATFORM_WINDOWS)
    9797        void moveCursor(int dx, int dy);
Note: See TracChangeset for help on using the changeset viewer.